ArrowFunctionExpression is not supported
gouravtiwari opened this issue · 5 comments
Hey @bendc
This is AWESOME list! Thanks for putting it together. There is one issue though and may be I misunderstood this one:
const isEven = n => n % 2 == 0;
This throws error: SyntaxError: Unexpected token '>'
also: ArrowFunctionExpression is not supported
This seems a coffee-script syntax, is it supported in JS?
@gouravtiwari Unfortunately the compatibility for this spec is low... If you don't use Firefox, you can use Babel or Traceur for transpiling it to ES5
@gouravtiwari. The arrow function is Ecmascript 6, the new version of Javascript. It has not been released yet and most features are not implemented in any Browser, but you can "transpile" it to ES5 (the current Javascript) using Traceur.
Agreed. Using arrow functions in a "front-end guidelines" writeup is pretty misleading.
At least a simple note about it only being supported in ES6 would be helpful (for myself and likely others).
Thanks @vitortalaia and @6temes, I just created a PR #747 for the same.
👍