EXERCISE 1: Variables and Output

Assignment

Create a simple JavaScript program that:

  1. Declares three variables:
    • firstName (your first name as a string)
    • age (your age as a number)
    • isStudent (a boolean set to true)
  2. Outputs the following to both the console AND the webpage:
    • "Hello, my name is [firstName]"
    • "I am [age] years old"
    • "I am a student: [isStudent]"
  3. Use both console.log() and document.write() to display the information.

Requirements:

  • Use proper variable declarations (let or const)
  • Use template literals (backticks) for string formatting
  • Include proper HTML structure
  • Use an external JavaScript file (script.js) linked to your HTML
  • The output should appear both in the browser console and on the webpage

Create an index.html file and a script.js file with your solution.