Get Array Of Values From A Js Object

[Solved] Get Array Of Values From A Js Object | Swift - Code Explorer | yomemimo.com
Question : get array of values from a js object

Answered by : antonio-velasco

const object1 = { a: 'somestring', b: 42, c: false
};
console.log(Object.values(object1));
// expected output: Array ["somestring", 42, false]

Source : https://developer.mozilla.org/es/docs/Web/JavaScript/Referencia/Objetos_globales/Object/values | Last Update : Thu, 04 Jun 20

Question : object get array of values

Answered by : dayana

const data = { "2015": { "year": 2015, "cover": {} }
}
Object.entries(data).forEach(([key, value]) => console.log(key, value));

Source : | Last Update : Thu, 13 May 21

Answers related to get array of values from a js object

Code Explorer Popular Question For Swift