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

138
Visualizações
Converting JSON data received from ajax call to an array

I am getting data in JSON format from an ajax call. I want to convert it into an array to be used in the js script.

 {
  "results":[
  {
     "activity":"A12345"
  },
  {
     "activity":"B12345"
  }]}

Array that I want to have

arr = ["A12345", "B12345"]

I tried the following steps -

var response = JSON.parse(data); 
var arr = response`enter code here`.results; 
var newArr = Object.entries(arr);
alert("New" + Object.values(arr));

The result that I am getting is

[object Object], [object Object]

How can I get the values from these objects and store it in an array. Please help!

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