Assignment
Create a simple JavaScript program that:
- Declares three variables:
firstName(your first name as a string)age(your age as a number)isStudent(a boolean set to true)
- 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]"
- Use both
console.log()anddocument.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.