- Practice using the fundamentals of JavaScript that were explored in lecture.
- Create a new project folder and connect it to a github repository. Copy this README.md file into it.
- Create an index.html file and an app.js file and link the two together.
- Create a variable that contains your name as a value. Name the variable appropriately.
- Create a constant that contains the number of states in the U.S. and name it appropriately.
- Compute the result of adding 5 and 4 and store it in an appropriately named variable.
- Write some code so that if your name starts with a letter after L, you display an alert that says "Back of the line!". Otherwise, you should display an alert that says "Next!".
- Add comments to your code to document its functionality.
- Write a function called sayHello that displays an alert that says Hello World!
- Call the sayHello function.
- Write a function called checkAge that takes two arguments: one for a name and one for an age. If the age is less than 21, display an alert that says "Sorry {{{toMarkdown}}}name{{{toMarkdown}}}, you aren't old enough to view this page!"
- Call the checkAge function 4 times with the following people: Charles who is 21, Abby who is 27, James who is 18, and John who is 17.
- Create an array of your favorite vegetables and name it accordingly.
- Use a loop to display each of your favorite vegetables to the developer console.
- Create an array of 5 objects that contain name and age properties. Make up names and ages for each object, making sure some are younger than 21 and some are 21+.
- Use a loop to call the checkAge function for each object in the array, passing the object's name and age as arguments.
- Create a function called getLength that takes any word as an argument. The function should return the number of characters in the string.
- Call the getLength function, passing 'Hello World' as the argument. Store the returned result of that function in a variable.
- Check the number in the variable from the previous objective. If the number is even, display 'The world is nice and even!' in the developer console. Otherwise if the number is odd, display 'The world is an odd place!' in the developer console.