• Post author:
  • Post category:Blog
  • Reading time:1 mins read
  • Post last modified:June 12, 2024

Analyze the code snippet:

let name;
let age;
{
let height;
// 2
 {  // 2
 { let weight;  // 1  // 2
 console.log(name);  // 1  // 2
  // 2
   console.log(name);  // 2
}

We have access to the weight variable:

  • in the part marked 1.
  • throughout the program.
  • nowhere, as we have no access at all (the variable has not been initialized).
  • in the part marked 2.
Answers Explanation & Hints:

 

For more Questions and Answers:

JavaScipt Essentials 1 (JSE) | JSE1 – Module 2 Test Exam Answers Full 100%

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments