Question 7
What will be logged on to the console, if the program written below is executed?
let x = 10var y = 10, z = 10{ let x = 20 var y = 20 function test() { var z = 20 }}console.log(x, y, z)10 20 10
20 20 20
10 20 20
10 10 10
What will be logged on to the console, if the program written below is executed?
let x = 10var y = 10, z = 10{ let x = 20 var y = 20 function test() { var z = 20 }}console.log(x, y, z)10 20 10
20 20 20
10 20 20
10 10 10
Correct answer
10 20 10
Question 7 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 16 Oct 2022, in the September 2022 term (IIT M QUIZ 1 FOUNDATION DAD DIPLOMA QPD2 16 Oct 2022). It carries 3 marks.