Created
July 26, 2016 06:44
-
-
Save katherholt/3f2c9239d555e8532d507fcf7d73b5f3 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
// Write a function arrayOfLight(x) (get it? Lighthouse…? Come on!) which takes one parameter, a positive number, and return | |
// an array containing all numbers from 0 up to and including the given number. | |
function arrayOfLight(x) { | |
var array = []; | |
for(var y = 0; y <= x; y++) { | |
array.push(y); | |
} | |
return array; | |
}; | |
arrayOfLight(4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment