Skip to content

underblob

<アンダブロッブ />

Tag: ES6

Better Object Traversal in Javascript

ES6 introduced Object.entries and destructuring and template strings:

for (let [key, val] of Object.entries(myObjectPrimitive)) {
  console.log(`myObjectPrimitive[${key}]: ${val}`);
}
Author underblobPosted on 2017.01.172017.01.17Categories TechTags code, ES6, Javascript
underblob Proudly powered by WordPress