U
U
Urushi Go2015-09-09 18:25:07
JavaScript
Urushi Go, 2015-09-09 18:25:07

How to fix "SyntaxError: Unexpected token {" error in Google Chrome?

Google Chrome throws a "SyntaxError: Unexpected token {" error while Mozilla Firefox is fine.
Short code example:
function Name( { x, y } ) { }

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nicholas, 2015-09-09
@UrushiGo

Apparently ES6 syntax is not yet supported in chrome.

V
Valentin Dubrovsky, 2015-09-09
@matroskin13

You are trying to use the syntax of the new js standard - es6 es6-features.org/#PropertyShorthand , and it is not yet supported by many browsers

A
abusabir, 2015-09-09
@abusabir

Check for chrome canary for interest, and then connect babel to the assembly of your project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question