Example:
let :test = "Hello";
console.log(test);
This code doesn't throw any error. Why?
Because you actually have a label https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
If you were in strict mode, it would have thrown an error.
let: // <-- label
test = "hello
let: test = "Hello";the:is part ofletwhich is a label here. You can tell that this is not a variable declaration because the console prints the value you assign. If it was a variable declaration it would printundefined. Also have running the code,testexists (not:test) and has the value"Hello". Same effect:foo :bar = "Hello";letis not a reserved word in non-strict mode: ecma-international.org/ecma-262/6.0/…, which means it can be used as variable name and other places. E.g.var let = 42;is valid in non-strict mode.