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

117
Visualizações
Check if value exist in array even if it is followed by other letters

I have an array with multiples values

let array = ['value othervalue', 'value2 othervalue2']

I want to check :

if (array.includes('value')){
    do that
}

It return false because its not 'value' its 'value othervalue'

I would like it to return true because the word is well existing but accompanied by another!

What javascript function can do that?

Thank you

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use Array.some to check whether one of the items includes 'value':

let array = ['value othervalue', 'value2 othervalue2']

if(array.some(e => e.includes('value'))){
  console.log('includes')
}

about 4 years ago · Juan Pablo Isaza Relatório
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