0

I get this error: SyntaxError: Unexpected token '>' at this line:

const isUsingDevice = (devices,value) => devices.some(d => value.includes(d));

How can I make the site not crash at this line, on older iOS devices?

4

1 回答 1

1

I get this error: SyntaxError: Unexpected token '>' at this line:

That's because Safari 9.x doesn't support arrow functions feature of ES6 (ES2015) which you employ in this statement:

(devices,value) => devices.some(d => value.includes(d))

BTW, it also provides just a basic support for const feature. You can check the whole picture here.

How can I make the site not crash at this line, on older iOS devices?

Use transpiler (babel or else) to transform the code written in ES6 into ES5 flavor.

于 2017-03-16T09:39:14.597 回答