Questions and Answers Latest Version
Already Passed
What will `if ([] == false) { console.log("Yes"); } else { console.log("No"); }` print?
A) Yes
B) No
C) Error
D) Undefined
✔✔ A) Yes
Which statement is used to terminate a `switch` case execution?
A) `stop`
B) `break`
C) `return`
D) `exit`
✔✔ B) `break`
What will `for (;;) {}` do?
1
,A) Run indefinitely
B) Throw an error
C) Run once and stop
D) Execute only if a condition is specified
✔✔ A) Run indefinitely
What is the output of `if (null) { console.log("True"); } else { console.log("False"); }`?
A) True
B) False
C) Undefined
D) Error
✔✔ B) False
Which statement correctly skips an iteration in a `for` loop?
A) `continue;`
B) `skip;`
C) `break;`
D) `return;`
2
, ✔✔ A) `continue;`
Which of these is NOT a valid loop structure in JavaScript?
A) `for`
B) `do...while`
C) `repeat...until`
D) `while`
✔✔ C) `repeat...until`
What will `if (10 && 0) { console.log("Run"); } else { console.log("Skip"); }` print?
A) Run
B) Skip
C) Error
D) Undefined
✔✔ B) Skip
Which statement correctly defines an infinite loop?
A) `for (let i = 0; i < Infinity; i++) {}`
3