Practice declaring variables, updating them, displaying values, and following naming rules.
Instructions:
console.log().✅ Output:
Before update:
Ali 22 Karachi
After update:
Ali 23 Karachi
🧩 JS-Practice-02 : Program 2 – Interactive Greeting
Objective:
Take user input using prompt() and display a greeting message using console.log() and alert().
Ask the user for their name using prompt().
Ask the user for their age using prompt().
Display a greeting message:
"Hello, <name>! You are <age> years old."
Use console.log() and alert() to show the message.
✅ How it works:
"Enter your name:" → user types Ali