Last active
          October 11, 2017 04:57 
        
      - 
      
- 
        Save kebien6020/e7b1b74239dfbc8e1911b9a9312c5197 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function* range(...args) { | |
| let start, stop, step | |
| if (args.length === 0) return | |
| if (args.length === 1) | |
| start = 0, stop = args[0], step=1 | |
| else | |
| [start, stop, step = 1] = args | |
| for (let i = start; step > 0 ? i < stop : i > stop; i += step) | |
| yield i | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment