const obj = { foo: "bar", baz: 42 }; console.log(Object.entries(obj)); // [ ['foo', 'bar'], ['baz', 42] ] const arrayLike = { 0: "a", 1: "b", 2: "c" }; console.log(Object.entries(arrayLike)); // [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ] const randomKeyOrder = { 100: "a", 2: "b", 7: "c" }; console.log(Object.entries(randomKeyOrder)); // [ ['2', 'b'], ['7', 'c'], ['100', 'a'] ] // 列挙可能でないプロパティ getFoo が
![Object.entries() - JavaScript | MDN](https://cdn-ak-scissors.b.st-hatena.com/image/square/aa767575b4232d312d2c5de428f0bf0955805e26/height=288;version=1;width=512/https%3A%2F%2Fdeveloper.mozilla.org%2Fmdn-social-share.cd6c4a5a.png)