Advertisement
xXCalleManXx

JavaSript Test #2

Sep 24th, 2020 (edited)
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. // Create a function that creates an array with the numbers 0 to X. You cannot use a loop, you cannot create multiple functions and the function must only contain one line.
  2. // Example:
  3. // When X is 10 the following array should be returned: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  4. // When X is 3 the following array should be returned: [0, 1, 2]
  5. // When X is 23 the following array should be returned [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement