JS: Browser Console SyntaxError: Unexpected token :
Uncaught SyntaxError: Unexpected token
One common error when using console is that when you type this:
{"x":3, "y":4};
and you get an error:
Uncaught SyntaxError: Unexpected token
It's a quirk in the JavaScript language. It thinks you are using a code block, not object.
Solution
solution is to wrap the object by parenthesis, like this:
({"x":3, "y":4})
In Google Chrome, omitting the semicolon also works. (but not in Firefox as of 2016-10-27)
{"x":3, "y":4}