Javascript Primer Quiz - Numbers
How many of these are a number
in JavaScript?
12
245.01
-9
twenty-thousand
let answer
tests({
'answer is correct': (t) => {
t.isEqual(answer, 3, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
}
})
Which of the following would best be represented using a
number
?
- The length of a movie in minutes
- An email address
- Whether it is raining or not
let answer
tests({
'answer is correct': (t) => {
t.isEqual(answer, 1, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
}
})
What is the result of the following?
let num = 5 * 5
let answer
tests({
'answer is correct': (t) => {
t.isEqual(answer, 25, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
}
})
What is the symbol used to represent division in JavaScript?
%
รท
*
/
let answer
tests({
'answer is correct': (t) => {
t.isEqual(answer, 4, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
}
})
Onwards!
You've completed the Numbers section of the quiz! Now, click here to continue to the Strings section.