11.
What will be the output of the following JavaScript code? Code: let x = 10; while (x > 0) { console.log(x); x -= 2; }
12.
What does the following JavaScript code snippet do? Code: let numbers = [1, 2, 3, 4, 5]; for (let i = 0; i < numbers.length; i++) { console.log(numbers[i]); }
13.
What is the purpose of the following JavaScript statement? continue;
14.
What will be the output of the following JavaScript code? Code: let nums = [1, 2, 3, 4, 5]; for (let n of nums) { if (n % 2 === 0) { console.log(n); } }
15.
What does the following JavaScript code snippet do? Code: let result = x > 0 ? "Positive" : (x < 0 ? "Negative" : "Zero");
16.
What will be the output of the following JavaScript code? Code: let i = 0; for (; i < 3; i++) { console.log(i); }
17.
What does the following JavaScript code snippet do? Code: let x = 5; while (x > 0) { console.log(x); x -= 1; }
18.
What is the purpose of the following JavaScript statement? return result;
19.
What will be the output of the following JavaScript code? Code: let i = 3; do { console.log(i); i--; } while (i > 0);
20.
What does the following JavaScript code snippet do? Code: let x = 10; if (x % 2 === 0) { console.log("Even"); } else { console.log("Odd"); }