Friday , September 20 2024

Analyze the following code: let height = 180; { let heigh = 200; height = height + 10; } console.log(height); As a result of its execution:

Questions BankCategory: JavaScript Essentials 1Analyze the following code: let height = 180; { let heigh = 200; height = height + 10; } console.log(height); As a result of its execution:
Analyze the following code:

let height = 180;
{
    let heigh = 200;
    height = height + 10;
}
console.log(height);

As a result of its execution:

  • the program will be terminated due to an error (re-declaration of the height variable).
  • a value of 210 will be displayed in the console.
  • a value of 200 will be displayed in the console.
  • a value of 180 will be displayed in the console.

More Questions: JavaScript Essentials 1 – JSE1: Module 2 Test