Skip to content

Instantly share code, notes, and snippets.

@leonardreidy
Created September 27, 2019 10:40
Show Gist options
  • Save leonardreidy/0c45e352ffdf260c93df318c0b355185 to your computer and use it in GitHub Desktop.
Save leonardreidy/0c45e352ffdf260c93df318c0b355185 to your computer and use it in GitHub Desktop.
let ob = { age: 41, name: 'Leonard', profession: 'JavaScript Developer' };
let obit = iteratorFactory(ob);
obit.next(); // returns { value: { age: 41 }, done: false }
obit.next(); // returns { value: { name: 'Leonard'}, done: false }
obit.next(); // returns { value: { profession: 'JavaScript Developer'}, done: false }
obit.next(); // returns { value: undefined, done: true }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment