Variable redeclaration in javascript [duplicate]

I have read that redeclaration of variables using let is not allowed in javascript.
If this is true, then how is it possible to redeclare a variable in block scope when it is already present in file scope using let in javascript?
Does this mean that file scope is not same as global scope?

let x = 10;
{
    let x = 2;
}
console.log(x)

The above code gives an output 10
But what I expected is an error
Kindly help me out in understanding this.