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

67
Visualizações
How do I find the placement of the first instance that the arrays string turns from A to D?

This is what I tried below but I can't figure this one out?

I tried several different approaches and seems like I'm missing a small piece of code to figure it out. I was thinking maybe to us If and break when it doesn't equal A and equals D but then how would I count in the array when this happened?

const testing = [`aTest`, ` aFun`, `aYay`, `      dFun  `, ,];

let firstLetterChangeAToD;
let firstLetter;
let testingArrayWord;
let largestWord;

for (let i = 0; i <= Object.keys(testing).length; i++) {
    testingArrayWord = testing[`${i}`].trim();
    firstLetter = testingArrayWord.charAt(0);
    console.log(firstLetter);
}
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