【发布时间】:2015-09-01 09:17:14
【问题描述】:
我在 iOS safari 上尝试评估是否存在与 at 正则表达式字符串匹配的数组时出现错误。
代码: this.productArray = ['array', 'with', 'stuff']
this.splittedString = string.split('/(\n\r|\r\n)|( )/igm')
_.each this.splittedString, (word, index) =>
for word of this.productArray
if this.splittedString[index].includes(this.productArray[word])
this.pushToArray('matchedProducts', this.productArray[word])
它在 Chrome 上运行没有问题,但 iOS Safari 会出现 TypeError:
TypeError: undefined is not a function(评估 '_this.splittedString[index].includes(_this.productArray[word])')
这太奇怪了。而且我只是无法弄清楚错误。谢谢。
【问题讨论】:
标签: javascript ios safari coffeescript typeerror