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
What is the keyword for extracting the day of the month? | getDate | getDate | |
What is the keyword for extracting the year? | getFullYear | getFullYear | |
The Date object has been assigned to the variable d. Code a statement that extracts the hours and assigns it to hrs, which hasn't been declared beforehand. | let hrs = d.getHours(); | lethrs=d\.getHours\(\); | |
The Date object has been assigned to the variable d. Extract the day number and assign it to x, which hasn't been declared beforehand. | let x = d.getDay(); | letx=d\.getDay\(\); | |
The Date object has been assigned to the variable now. Display the year in an alert. | alert(now.getFullYear()); | alert\(now\.getFullYear\(\)\); | |
The Date object has been assigned to the variable x. Code the first line of an if statement that tests whether it's the last quarter of the year. | if (x.getMonth() > 8) { | if\(x\.getMonth\(\)>8\){ | |
The Date object has been assigned to the variable d. Code the first line of an if statement that tests whether it's before noon. | if (d.getHours() < 12) { | if\(d\.getHours\(\)<12\){if\(d\.getMinutes\(\)===0\){const theHour = d.getHours(); | |
Code the first line of an if statement that tests whether the clock is at an hour on the dot, not a minute before or after the hour. Check minutes only. Ignore seconds and milliseconds. Make up the variable to hold the Date object. | if (d.getMinutes() === 0) { | if\([a-z_$][a-zA-Z0-9_$]*\.getMinutes\(\)===0\){ | |
|
|||
|