console,一次性输入进去
var xxxx = 2;
var xxxx = 3;
可以
let yyyy = 2;
let yyyy = 3;
Uncaught SyntaxError: Identifier 'yyyy' has already been declared
分两次输入console,可以
var mmmm = 2;
let mmmm = 3;
Uncaught SyntaxError: Identifier 'mmmm' has already been declared
分两次输入console,Uncaught SyntaxError
let tttt = 2;
var tttt = 3;
Uncaught SyntaxError: Identifier 'tttt' has already been declared
分两次输入console,Uncaught SyntaxError
查了一会,中文似乎没提这个的,这是chrome的一个独特特性
https://dev.to/cooldashing24/chrome-now-allows-for-let-and-class-redeclarations-in-the-console-2m0f
https://developer.chrome.com/blog/new-in-devtools-92/#const-redeclaration