alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

Javascript objects key manipulation issue [closed] ?

Javascript objects key manipulation issue [closed] ?

Try This 

 let data = {
  car: {
    model: 1999,
  },
  van: {
    model: 1850,
  },
};
let dataarray = Object.entries(data);
data = {};
for (let i = 0; i < dataarray.length; i++) {
  data[dataarray[i][0]] = dataarray[i][1].model;
}
console.log(data);

22 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online