Created
February 9, 2016 20:08
-
-
Save Ebonkuab/3c8718e17597ee6659d5 to your computer and use it in GitHub Desktop.
javascript code for showing an array of numbers given an input
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 (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