Skip to content

Instantly share code, notes, and snippets.

@raySavignone
Created April 13, 2015 19:11
Show Gist options
  • Save raySavignone/b9a2e27ecca3d4940589 to your computer and use it in GitHub Desktop.
Save raySavignone/b9a2e27ecca3d4940589 to your computer and use it in GitHub Desktop.
Array of light
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