Skip to content

Instantly share code, notes, and snippets.

@Ebonkuab
Created February 9, 2016 20:08
Show Gist options
  • Save Ebonkuab/3c8718e17597ee6659d5 to your computer and use it in GitHub Desktop.
Save Ebonkuab/3c8718e17597ee6659d5 to your computer and use it in GitHub Desktop.
javascript code for showing an array of numbers given an input
var ArrayOfLight = function (num) {
var arrayOfNumber = []
var i = 0 ;
var counter = 0;
while (counter <= num){
arrayOfNumber.push(i)
i = i + 1
counter = counter + 1
}
return arrayOfNumber;
}
console.log(ArrayOfLight(10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment