Skip to content

Instantly share code, notes, and snippets.

View developandbehappy's full-sized avatar
🎯
Focusing

Who am i? developandbehappy

🎯
Focusing
View GitHub Profile
@developandbehappy
developandbehappy / Iterables.es6.js
Last active August 29, 2015 14:27 — forked from asm0dey/Iterables.es6.js
Simple library with lazy es6 iterables. If you use es5 - don't forget to add es5 polyfill
function range(start, finish, step = 1) {
if (step < 1) throw "Step must be ge 1"
return {
[Symbol.iterator]: function* () {
let count = 1;
yield start
if (start !== finish) {
let tmp = start;
if (start < finish) {
while (tmp < finish) {