A Pen by Mykhas' Kobernyk on CodePen.
Created
August 19, 2014 10:22
-
-
Save mykhas/26340dd47d69f6ab8405 to your computer and use it in GitHub Desktop.
A Pen by Mykhas' Kobernyk.
This file contains 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
var iterate = function(start, finish, step){ | |
var upIterate = function(start, finish, step){ | |
(start <= finish) && console.log(start); | |
(start < finish) && upIterate(start+step, finish, step); | |
} | |
var downIterate = function(start, finish, step){ | |
(start >= finish) && console.log(start); | |
(start > finish) && downIterate(start+step, finish, step); | |
} | |
console.log('in @iterate'); | |
(step > 0) && upIterate(start, finish, step); | |
(step < 0) && downIterate(start, finish, step); | |
} | |
iterate(0, -5, -1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment