JavaScript Basics Assessment
Before continuing with the lessons go ahead and attempt the following assessment. These will be a good way to test your understanding of the knowledge you just gained.
Instructions:
- Create a new folder in your prework repo called
JavaScript_Basics_Assessment
. - Complete the following activities in separate files named after each activity,
activity-2.js
, etc. - When you have completed the activities push the files to your GitHub Repo.
Activity 1: JavaScript Math Quiz:
Using JavaScript, compute the following:
- The product of 9 and 9
- The quotient of 56 and 12
- The remainder of 281 divided by 9
- 18 divided by 0
- The sum of string 56 and string 92
- Using any comparison operator you wish on the numbers 42 and 52, make it evaluate to
false
.
Activity 2: JavaScript Variables, Alerts, Prompts, and Conditionals:
- Grab a user input using a
prompt()
and store it in a variable. - Add a conditional statement where if the variable's length is greater than
4
, we alert the user that their name is greater than four characters. - Otherwise, alert that their name is less than four characters.
Activity 3: JavaScript Arrays and Loops:
- Start off by creating an array with three student names.
- Create a loop that will prompt the user for three more names.
- After every user input, store the new name into the array.
- Create a new loop that will iterate through the array and console log each element of the array.