summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/let-scoping.js
blob: 27c92e23f9c63cd824b75d03b3e45219786c92ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
test("let scoping", () => {
    let i = 1;
    {
        let i = 3;
        expect(i).toBe(3);
    }
    expect(i).toBe(1);

    {
        const i = 2;
        expect(i).toBe(2);
    }
    expect(i).toBe(1);
});