Created
January 24, 2014 18:01
-
-
Save slopeofhope81/8602617 to your computer and use it in GitHub Desktop.
/*Write a function range that takes one argument, a positive number, and returns an array containing all numbers from 0 up to and including the given number.*/
This file contains hidden or 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 arr = []; | |
function list(n) { | |
for (var i = 0; i <= n; i++) { | |
arr[i] = i; | |
} | |
document.write(arr); | |
} | |
list(20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment