Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda