[ES2017] Iterate over properties of an object with ES2017 Object.entries()
Posted Answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[ES2017] Iterate over properties of an object with ES2017 Object.entries()相关的知识,希望对你有一定的参考价值。
The Object.entries()
function is an addition to the ECMAscript scpec in Es2017. This allows us to iterate through the properties of an object and read the entries as keys and objects.
const obj = { foo: ‘bar‘, baz: 42 }; console.log(Object.entries(obj)); // [ [‘foo‘, ‘bar‘], [‘baz‘, 42] ]
以上是关于[ES2017] Iterate over properties of an object with ES2017 Object.entries()的主要内容,如果未能解决你的问题,请参考以下文章
How to Iterate Over a Map in Java?
[Javascript] Iterate Over Items with JavaScript's for-of Loop
python 来自http://stackoverflow.com/questions/12325608/iterate-over-a-dict-or-list-in-python/12325691#
How do I iterate over a Scala List (or more generally, a sequence) using theforeach method or for lo