Despite the slim chances of living, you have survived this far. However, now, you are forced to help me. I heard that you were a famous programmer and I will need your advice. If you give me the wrong answer you will perish, else, I will let you live to see another day. Which of the following describes what happens when the following code is executed in Javascript:
for(i = 1; i < 100; i++){
if(i%3 === 0){
console.log(i);
}
}
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
It is a for loop for values "i" less than 100. If i = 0 mod(3), meaning if i is divisible by 3, then the program will output the value of i that satisfies the condition. Therefore, all multiples of 3 less than 100 will be displayed.