1
转化我无法弄清楚如何获得此代码转换为兼容的代码在Node.js的V4 ENV:[].includes('anything')
Array.prototype.includes - 不与巴贝尔
监守,这将引发在Node.js的V4 Error: includes is not a function...
错误
谁能帮我理解为什么babel
不会变换.includes()
?我一直在使用巴贝尔预设-ES2015和巴贝尔预设-es2016以及巴贝尔REPL尝试:Example babel repl code usage
因为它是polyfillable。 Polyfillable功能不会被转译。 – estus
您需要一个polyfill来包含像'.includes()'这样的ES6方法。 – jfriend00
https://babeljs.io/docs/usage/polyfill/ –