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
Type the operator that means and. | && | && | |
Type the operator that means or. | || | \|\| | |
Code the first line of an if statement that tests whether both are true: a's value is the same as b's value and c's value is the same as d's value. | if (a === b && c === d) { | if\(a===b&&c===d\){ | |
Code the first line of an if statement that tests whether a's value is the same as b's value and/or c's value is different from d's value. | if (a === b || c !== d) { | if\(a===b\|\|c!==d\){ | |
Code the first line of an if statement that tests whether both are true: a first variable's value is the same as a second variable's value and is also the same as a third variable. Make up the variable names. | if (a === b && a === c) { | if\(([a-z_$][a-zA-Z0-9_$]*)===[a-z_$][a-zA-Z0-9_$]*&&\1===[a-z_$][a-zA-Z0-9_$]*\){ | |
What is the value of e? | let a = 1; let b = 2; let c = 3; let d = 4; let e = c; if (c === 3 * a && a > 0 && (a < d || d < a)) { e = a; } else { e = b; } |
1 | 1 |
Complete the first line of this if statement that tests whether make === "VW" regardless of miles or make === "Fiat" and miles > 100000. | if (make === "VW"... |
|| make === "Fiat" && miles > 100000) { | \|\|make===•Fiat•&&miles>100000\){ |
Complete the first line of this if statement that tests whether make is either "VW" or "Fiat" and, whichever make, miles > 100000. | if ((make === "VW"... |
|| make === "Fiat") && miles > 100000) { | \|\|make===•Fiat•\)&&miles>100000\){ |
|
|||
|