object itetration in es6 code example
Example 1: es6 loop through object
for (var [key, value] of phoneBookMap) {
console.log(key + "'s phone number is: " + value);
}
Example 2: javascript iterate object
for (let key in yourobject) {
if (yourobject.hasOwnProperty(key)) {
console.log(key, yourobject[key]);
}
}