Question from the Javascript - Fundamentals test

How to use let in a block scope in Javascript

Easy

What does this code displays ?

    let x = 1;
    if (true) {
        let x = 2;  
        console.log(x);  
    }
    console.log(x); 
Author: karimStatus: PublishedQuestion passed 194 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!