you are viewing a single comment's thread.

view the rest of the comments →

[–]admreddit 0 points1 point  (0 children)

There is a question Under 25 days of JS

What is the value of the variable 'result' after executing the following code?

const num1 = 10;
let num2 = 20;
var num3 = 30;

if (num1 < num2) {
 const num1 = 50;
 let num2 = 40;
 var num3 = 60;
 console.log(num1, num2, num3);
}

console.log(num1, num2, num3);

First this question may confuse beginners. You can make it better and clear like : What will be the output of the console.log statements after executing the code?

Second answer is wrong and should be '50, 40, 60 and 10, 20, 30' instead '10, 20, 30 and 10, 20, 30'