+ 4
Just think about it. I will just remove the code that doesn't run:
for (var i = 0; i < 10; i++) {
for (var j = 0; j >= 2; j++) {
for (var k = 0; k < 5; k++) {
x++
}
}
}
Then removed:
for (var i = 0; i < 10; i++) {
//for (var j = 0; j >= 2; j++) {
//for (var k = 0; k < 5; k++) {
//x++;
//}
//}
}
To:
for (var i = 0; i < 10; i++) {
}
+ 4
First:
The second loop never executes. If you look at it closely, it's j >= 2, and that will never be true.
Second:
The inputs are added before being evaluated (you know, like with parentheses). "1" + "2 * 2" is "12 * 2), and that's evaluated to 24
+ 4
Third loop and x++ are statements inside second loop and when it will never run, they won't run too. So "x" remains 1.