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?

rosu alin
  • 5,674
  • 11
  • 69
  • 150

1 Answers1

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.

raina77ow
  • 103,633
  • 15
  • 192
  • 229