Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

comparing two arrays with filter javascript

var fullWordList = ['1','2','3','4','5'];
var wordsToRemove = ['1','2','3'];

var filteredKeywords = fullWordList.filter(
  word=>!wordsToRemove.includes(word)
//or
//word=>wordsToRemove.indexOf(word)<0
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #comparing #arrays #filter #javascript
ADD COMMENT
Topic
Name
8+2 =