Object.entries(), Object.keys() и Object.values().
const obj = { a: 1, b: 2, c: 3 };
Object.entries(obj);
// Output
// (3) [Array(2), Array(2), Array(2)]
// 0: (2) ["a", 1]
// 1: (2) ["b", 2]
// 2: (2) ["c", 3]
// length: 3
Object.keys(obj);
// (3) ["a", "b", "c"]
Object.values(obj);
// (3) [1, 2, 3]
WebDEV #советы #coding #js