网站无法在 ipad 8.4.1 上运行,但可在较新的 ipad 或 Android 或 pc 上运行

Site does not work on a ipad 8.4.1 but works on newer ipads, or Android or pc

我收到这个错误: SyntaxError: Unexpected token '>' 在这一行:

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

如何使网站在较旧的 iOS 设备上不会在此行崩溃?

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

那是因为 Safari 9.x 不支持您在本声明中使用的 ES6 (ES2015) 的 arrow functions 特性:

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

顺便说一句,它还提供了对 const 功能的基本支持。可以查看全图here.

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

使用转译器(babel 或其他)将用 ES6 编写的代码转换为 ES5 风格。