Skip to content

Instantly share code, notes, and snippets.

View ScottRudiger's full-sized avatar
🎯
Focusing

Scott Rudiger ScottRudiger

🎯
Focusing
View GitHub Profile
@ScottRudiger
ScottRudiger / makeObjIterable.js
Last active January 19, 2018 04:30
Make a JavaScript Object Iterable
const makeIterable = obj => Object.defineProperty(obj, Symbol.iterator, {
writable: true,
value: function*() {
const values = Object.values(obj);
for (let value of values) {
yield value;
}
},
});