1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
The statement below creates a Date _____. | const now = new Date(); | object | object |
When you extract the day from a Date object, you get an integer, not a string. What is the number that means "Sat"? Answer with a numeral, like 1. | 6 | 6 | |
Fill in the blank to create a new Date object. | const dObj = new _______; | Date() | Date\(\) |
Fill in the blank to create a new Date object. | const dObj = ____________; | new Date() | newDate\(\) |
Code a statement that creates a new Date object for your birthday. Make up the variable name. | Example: const specialDate = new Date("June 21, 1989"); | const[a-z_$][a-zA-Z0-9_$]*=newDate\(•\w+\d{2},\d{4}•\); | |
Given the code below, fill in the blank to extract the day of the week and assign it to the variable today. | const d = new Date(); const today = _________; |
d.getDay() | d\.getDay\(\) |
Given the code below, extract the day of the week and assign it to a variable that hasn't been declared previously. Make up the name of the variable. | const d = new Date(); | const today = d.getDay(); | const[a-z_$][a-zA-Z0-9_$]*=d\.getDay\(\); |
The day has been extracted from the Date object and assigned to the variable dayNumber. The names of the days of the week have been assigned to the array dayNames. Fill in the blank. | alert("Today is " + ___________); | dayNames[dayNumber] | dayNames\[dayNumber\] |
|
|||
|