Conclusion:
There is no problem with the test in the page, the code executes normally, and the result is a = 2.
For the moment, it is inferred that there is a difference between the executing code in the Chrome console and the executing process in the page. It may be a problem of lexical parsing or execution stage. We will explore the details in the future when we have more knowledge about the corresponding knowledge
1.1,
a = 2
let {a} = a;
Note: Input separately
The rest is the same as the input
1.2,
a = {F: 1}
let {a} = a;
1.3,
a = {a: 2}
let {a} = a;
Var and const cannot be reassigned. Let can be reassigned.
When let is not used, a has a value and can be assigned by var, let, and const
2.1,
var a = 2
let {a} = a;
You can see that a becomes undefined
Note: Input separately
You can see that a is not defined
2.2,
var a = {F: 1}
let {a} = a;
2.3,
var a = {a: 2}
let {a} = a;
Var, const, let, const, let, var, const, let
3.1,
let a = 2
let {a} = a;
3.2,
let a = {F: 1}
let {a} = a;
3.3,
let a = {a: 2}
let {a} = a;
4.1,
const a = 2
let {a} = a;
4.2,
const a = {F: 1}
let {a} = a;
4.3,
const a = {a: 2}
let {a} = a;