I do not want to use any loop or any of the usual loops, I try to use forEach, but I get an error
Uncaught TypeError: data.forEach is not a function
return falsyData.map(function(data) {
data.forEach(function(key) {
if (key.match(reg)) {
return key;
}
});
});
but if I do this, this will work:
return falsyData.map(function(data) {
for (var key in data) {
if (key.match(reg)) {
return key;
}
}
});
why?
source
share