Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

318
Visualizações
The Odin Project - Fundamentals 04 remove an array

I have problems with exercise 04 at The Odin Project JS Fundamentals. Implement a function that takes an array and some other arguments then removes the other arguments from that array:

removeFromArray([1, 2, 3, 4], 3); // should remove 3 and return [1,2,4]

I found a solution and tested it successful on my chrome-console, but it fails every test in the terminal (with npm test ...). I don`t know whats wrong with the code. My solution:

const removeFromArray = function(arr, ...args) {
  let a = arr;
  let b = args;
  let c = a.filter(d => !b.includes(d));
  console.log(c);
};

I used the variables a, b, c, d to make it more understandable for myself. Could this be the problem?

Thank you!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda