Created
April 13, 2015 19:11
-
-
Save raySavignone/b9a2e27ecca3d4940589 to your computer and use it in GitHub Desktop.
Array of light
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 arrayOfLight = function(positiveNumber){ | |
if (positiveNumber < 0 ) { | |
alert("Number must be a positive"); | |
} else { | |
var result = []; | |
for (i=0; i <= positiveNumber;i++) { | |
result[i] = i; | |
} | |
console.log(result); | |
} | |
} | |
arrayOfLight(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment