Last active
April 3, 2018 12:16
-
-
Save indongyoo/0d5eabc5dac9b9bec23adb3ffdc3780f to your computer and use it in GitHub Desktop.
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
function *valuesIter(obj) { | |
for (const key in obj) yield obj[key]; | |
} | |
const users = { | |
5: { id: 5, name: 'YB' }, | |
19: { id: 19, name: 'BX' }, | |
27: { id: 27, name: 'MD' } | |
}; | |
for (const val of valuesIter(users)) log(val.name); | |
// YB | |
// BX | |
// MD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment