Skip to content

Instantly share code, notes, and snippets.

@OdeToCode
Created October 23, 2014 12:32
Show Gist options
  • Select an option

  • Save OdeToCode/1d010178a02a038ce9b5 to your computer and use it in GitHub Desktop.

Select an option

Save OdeToCode/1d010178a02a038ce9b5 to your computer and use it in GitHub Desktop.
let range = function*(start, end){
let current = start;
while(current < end){
let newValue = yield current;
current = newValue ? newValue : current + 1;
}
};
let stuff = range(0,3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment