kiknaio
8/27/2016 - 3:55 PM

Turning object into an array - JavaScript

Turning object into an array - JavaScript

let persons = {
  "George Kiknadze" : {
    "name" : "George",
    "lasntame" : "Kiknadze"
  },
  "Luka Kiknadze" : {
    "name" : "Luka",
    "lastname" : "Kiknadze"
  }
};

let personsArray = Object.keys(persons).map((value)=> {
  return persons[value];
});