Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save OdeToCode/1d3f72f9897f3387d870 to your computer and use it in GitHub Desktop.
let range = function*(start, end){
for(var i = start; i <= end; i++){
yield i;
}
};
let n = [for (x of range(0,3)) x];
expect(n).toEqual([0,1,2,3]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment