javascript - Simple JS Arrow Function: Missing Parenthesis After Argument List: Why? -
this simple javascript arrow function results in parser error. syntax seems consistent examples i've seen. syntax error , how correct it?
var things = []; things.push("a"); var containsa = things.some(t => t === "a");
the error: uncaught syntaxerror: missing ) after argument list
your code produces valid arrow function:
t => t === "a"
however, arrow functions experimental technology, part of ecmascript 6 proposal, still draft. therefore, not browsers have implemented them yet.
among major ones, firefox has. if attempt use them on chrome, error.
Comments
Post a Comment