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

515
Vistas
Array.push throws an error Cannot add property 0, object is not extensible

I'm a bit stuck with something (hoping simple), maybe someone here can have a look and point that simple thing I'm missing. I am getting some objects and wanna push them to an array. on push, getting the error: Cannot add property 0, object is not extensible

if (keysLength > 0) {
    //@ts-ignore
    let Arr = [];

    for(let x = 0; x < keysLength; x++) {
        let keys = "item" + x;
        // getting all the items from storage 
        // and merging into 1 array
        chrome.storage.sync.get([keys], function(result) {
            // err: Cannot add property 0, object is not extensible
            Arr.push(result[keys]);
        });
        if (x === keysLength-1){
            console.log(Arr)
        }
    }
}

appreciate the time

about 4 years ago · Juan Pablo Isaza
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