Last active
November 14, 2017 22:17
-
-
Save aderaaij/0f5145364069941fedcdb36863f82d02 to your computer and use it in GitHub Desktop.
A simple for in loop to iterate over object values
https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Statements/for...in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Statements/for...in | |
const hulk = { | |
color: 'Green', | |
size: 'Large', | |
weight: 500, | |
power: 'Super Strength', | |
}; | |
for (const prop in hulk) { | |
console.log(`${prop}: ${hulk[prop]}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment