Created
July 22, 2015 03:31
-
-
Save mgelios/9fe60a93083872edf0f5 to your computer and use it in GitHub Desktop.
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 log = false; | |
var iterate = function (left, right, step) | |
{ | |
log = (left - right <= 0 && step > 0 || left - right >=0 && step < 0); | |
(log) && console.log(left); | |
left += step; | |
(log) && iterate(left, right, step); | |
} | |
var tempValue = iterate(5, -5, -2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment