Skip to content

Instantly share code, notes, and snippets.

@GalindoSVQ
Last active March 27, 2022 06:58
Show Gist options
  • Save GalindoSVQ/fcd1c3d07c2b8afa4779c08a95dc32fb to your computer and use it in GitHub Desktop.
Save GalindoSVQ/fcd1c3d07c2b8afa4779c08a95dc32fb to your computer and use it in GitHub Desktop.
const response = []
const userObj = {
id: "fd70a8cd-32b5-437a-98b6-2363bda276f1",
name: "Antonio",
lastName: "Galindo",
cardId: 123456789
};
userObj[Symbol.iterator] = function* () {
const values = Object.values(userObj);
for (const value of values) {
yield value;
}
};
for (const prop of userObj) {
response.push(prop)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment