Answers for "filter out multiple items in array es6"

0

remove multiple elements from array es6

const colors=["red","green","blue","yellow"];
let index = colors.length - 1;
while (index >= 0) {
  	if (['green', 'blue'].indexOf(colors[index]) > (-1)) {
    	colors.splice(index, 1);
  	}
  	index -= 1;
}
Posted by: Guest on July-05-2021

Code answers related to "filter out multiple items in array es6"

Code answers related to "Javascript"

Browse Popular Code Answers by Language