Doing a while loop in JavaScript but it's displaying 120 when usernum < 50 but calculating when usernum is 60.
var userNum = 4; // Code will be tested with values: 4, 10 and 60
/* Your solution goes here */
do {
userNum = 2 * userNum;
console.log(userNum);
}
while (userNum < 50);
CORRECT Testing displayed output with userNum = 4 Yours 8 16 32 64
CORRECT Testing displayed output with userNum = 10 Yours 20 40 80
INCORRECT Testing displayed output with userNum = 60 Yours and expected differ. See highlights below. Yours 120 Expected Expected no output
whileis not the same asdo-while.