Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

504
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!