来自mozillas js文档: for (variable of iterable) { } 这是js中of语句的标准,我想这样做: for (variable of我有两个数组,我正试图遍历它们,并想要创建对象并检查它们的相等性(或其他东西)。console.log(numCorrect) } } 基本上,我对交集所做的是使用underscoreJS检查两个数组是否相交在此之后
下划线为数组的交集、差集和并集提供了方便的函数。但对于对象数组,它们并不能像预期的那样工作:var otherFirst = {val: 1};_.difference([first, second], [otherFirst]); // result is [first, second] instead of [second]我