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

191
Visualizações
How can I convert this object into an Array using GAS?

I got this showing as an object: 38,44,46 ...while and it should be: ["38","44","46"]

I'd like to convert it to an Array, so that I can iterate over it. I've tried doing so using this, but it's still an object, as I get its type: let tamanhosEsc = Object.values(values[29]);

This is how values is created:

const rngList = cadSheet.getRangeList(dataRng).getRanges();

  let values = new Array();

  for(let i = 0; i < rngList.length; i++) {
    let data = rngList[i].getValue();
    values.push([data]);
  }

I've tried creating it by specifying it as an Array, but still...

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

0

Play with the code above to understand the basic concept:

var obj = {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0}
var result = Object.keys(obj).map((key) => [Number(key), obj[key]]);

console.log(result);
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