Beginner JavaScript Exercises:
- Create a variable and store your name in it.
- Write a function that adds two numbers and returns the result.
- Display an alert with a greeting message.
- Use the
console.log
to print "Hello, World!" to the browser console. - Create an array of fruits and access a specific fruit by its index.
- Write a function that takes a number as an argument and returns whether it's even or odd.
- Use a for loop to print numbers from 1 to 10 in the console.
- Create an object representing a person with properties like name and age.