Question: My code currently only .pushes, 1,2,3. But i need 1,2,3,4 to be pushed into the array, range. If i = 0, it pushes = 0,1,2,3
My code currently only .pushes, 1,2,3. But i need 1,2,3,4 to be pushed into the array, "range". If i = 0, it pushes = 0,1,2,3 which is not what i want
Loops Create a function called range 1 parameter: max - the number to count up to returns: an Array containing all numbers between 1 and max 1 function range(max) { 2 // YOUR CODE BELOW HERE // 3 var toReturn = []; 4 for (i = 1; i returns [1, 2, 3] range (5); //==> returns [1, 2, 3, 4, 5] Run Run Submit Submit Auto-Run OFF Reset
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
