JavaScript | Introduction To JavaScript| Question 5

Last Updated :
Discuss
Comments

What will be the output of this JavaScript code?

JavaScript
let a = 5;
function test() {
  let a = 10;
  console.log(a);
}
test();
console.log(a);

5 and 10

10 and 10

5 and 5

10 and 5

Share your thoughts in the comments