Why is {"foo":'bar'} causes an error?

Actually, why if you write to the console of the browser, {foo:'bar'} then throw 'bar', and {"foo":'bar'} causes an error?
If you write var someObj = {foo:'bar'}, then there will be no error.
It seemed to me that the quotation marks only shield the property name, and then something strange happens.
September 19th 19 at 12:43
1 answer
September 19th 19 at 12:45
Solution
Because foo: in this context, it is a label https://developer.mozilla.org/ru/docs/Web/JavaScri...
Achtung! I completely forgot about them. - Daniela commented on September 19th 19 at 12:48

Find more questions by tags JavaScript