So, I noticed that on CodePen invalid property accessors that should give Syntax Error is working.
I have a res object:
let res = {
"a" : {
"b" : 123
},
"c" : 3
}
When I do:
console.log("Valid: ", res["a"]["b"])
console.log("Invalid: ", res.["a"].["b"])
I get a response on the console:
"Valid: " 123
"Invalid: " 123
As far as I know res.["a"].["b"] is invalid JavaScript Syntax and it doesn't work elsewhere.
Is there any reason why it's implemented this way or am I missing something?
Here's a link to my CodePen containing the code.