标签: javascript ios ipad syntax-error unexpected-token
我收到此错误: SyntaxError: Unexpected token '>' 在这一行:
SyntaxError: Unexpected token '>'
const isUsingDevice = (devices,value) => devices.some(d => value.includes(d));
如何在较旧的iOS设备上使网站不会崩溃?
答案 0 :(得分:1)
我收到此错误:SyntaxError:意外的令牌'>'在这一行:
这是因为Safari 9.x不支持您在本声明中使用的ES6(ES2015)的arrow functions功能:
arrow functions
(devices,value) => devices.some(d => value.includes(d))
const
使用transpiler(babel或其他)将ES6中编写的代码转换为ES5风格。