Challenge 1
Write the condition that checks whether score is at least 80.
if (score ) { result = "pass"; }
Press Ctrl⌘Enter to check your answer
Practice branching, switch control, loop control, returns, exceptions, cleanup, and safe return syntax by completing real JavaScript code.
Challenge 1
if (score ) { result = "pass"; }
Press Ctrl⌘Enter to check your answer
Challenge 2
case "save":
result = "saved";
case "load":
Press Ctrl⌘Enter to check your answer
Challenge 3
for (const value of values) {
if (value === 0)
output.push(value);
}
Press Ctrl⌘Enter to check your answer
Challenge 4
function classify(ok) {
if (ok)
return "retry";
}
Press Ctrl⌘Enter to check your answer
Challenge 5
if (!name) {
}
Press Ctrl⌘Enter to check your answer
Challenge 6
try {
riskyWork();
} {
console.log(error.message);
}
Press Ctrl⌘Enter to check your answer
Challenge 7
try {
riskyWork();
} catch (error) {
report(error);
} {
cleanup();
}
Press Ctrl⌘Enter to check your answer
Challenge 8
function value() {
return ;
}
Press Ctrl⌘Enter to check your answer