logo CodeStepByStep logo

loopMystery2

Language/Type: JavaScript for loops loop mystery
Author: Melissa Hovik (on 2016/09/25)

What is the output of the following JavaScript code?

let num = 4;
for (let count = 1; count <= num; count++) {
    console.log(num);
    num -= 2;
}
output

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.