9
rated 0 times
[
12]
[
3]
/ answers: 1 / hits: 54474
/ 7 Years ago, wed, august 9, 2017, 12:00:00
I'm having some issues comparing the elements of two arrays and filtering out matching values. I only want to return array elements that are NOT included within wordsToRemove
.
var fullWordList = ['1','2','3','4','5'];
var wordsToRemove = ['1','2','3'];
var filteredKeywords = fullWordList.forEach(function(fullWordListValue) {
wordsToRemove.filter(function(wordsToRemoveValue) {
return fullWordListValue !== wordsToRemoveValue
})
});
console.log(filteredKeywords);
More From » javascript