If you run this code in the console:
(function(){
test: "hello";
})();
Or even this:
test: "hello";
Nothing happens and no error occurs. What for? It's as simple as, "Good ... This is JavaScript ... Deal with it."
In the context, some interns at my company wrote something similar by chance (which means using "="). When they were faced with the fact that this is likely to cause an error, they said that this did not happen.
And now I'm curious.
Fully source
share