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

68
Visualizações
Where is data located in an object?

For taking data from a form, I use new FormData. Please see the sample code below. Click submit and the data will be displayed in the console.

There is an array of data in the first log (using spread operator), and there is an object of data in the second log, but when I look up the data in the object in console log I can't find it. I want to know where the data in Object is located.

const  form = document.querySelector('form');

form.addEventListener('submit', function(e){
    e.preventDefault();
    const data = new FormData(form)
    
    // first log is an array
    console.log([...data])

    // second log is an Object
    console.log(data)
})
<body>
<form>
    <label >input1</label>
    <input name="input1"  type="text"  value='test1' />

    <label >input1</label>
    <input  name="input1"  type="text"  value='test2' />

    <button type="submit">Submit</button>

</form>

</body>

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