Skip to content

Instantly share code, notes, and snippets.

@dimitris-papadimitriou-chr
Created July 20, 2019 19:31
Show Gist options
  • Save dimitris-papadimitriou-chr/8ea901d53198aa60fb9325026b4308ba to your computer and use it in GitHub Desktop.
Save dimitris-papadimitriou-chr/8ea901d53198aa60fb9325026b4308ba to your computer and use it in GitHub Desktop.
Object.prototype.getIterator = function () {
var self = this;
return {
*[Symbol.iterator]() {
{
var content = self.fold([],(acc,e)=>acc.concat( e ) )
for (var element of content) yield element;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment