Reputation: 33
Example:
let :test = "Hello";
console.log(test);
This code doesn't throw any error. Why?
Upvotes: 3
Views: 149
Reputation: 207521
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
Upvotes: 5