The javascript code:
for (j = 0; j < array.length; j ++) {
if (
array[j].some(
function(word) {
return word.indexOf(array1[i]) > -1;
}
)
) {
makeSomething();
}
}
produces a Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (array1)
warning in jshint.com
.
Actually it works.
Is it really problematic?
How should it be written?