“Remova o item da matriz se existe em outra matriz” Respostas de código

Remova o item da matriz se existe em outra matriz

myArray = myArray.filter( function( el ) {
  return !toRemove.includes( el );
} );
Mystic Dev

Remova o item da matriz se existe em outra matriz

myArray = myArray.filter( ( el ) => !toRemove.includes( el ) );
Mystic Dev

Remova o item da matriz se existe em outra matriz

$filteredFoo = array_diff($foo, $bar);
Real Rhinoceros

Remova o item da matriz se existe em outra matriz

myArray = myArray.filter( function( el ) {
  return toRemove.indexOf( el ) < 0;
} );
Mystic Dev

Respostas semelhantes a “Remova o item da matriz se existe em outra matriz”

Perguntas semelhantes a “Remova o item da matriz se existe em outra matriz”

Procure respostas de código populares por idioma

Procurar outros idiomas de código