Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 ResetStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started