![]() ![]() Call the getstats function and pass your numbers array as the argument and assign the return value to a new variable named counterstats. After your function definition's code block, do the following: a. Return the stats object from the function. length) and assign the result to the average property of the stats object (i.e. Divide the value of the total variable by the length property of the numberList (i.e. Do not use the Math object or any other built-in JavaScript function to find the sum of the numbers in numberlist. Use a for loop to sum all of the numbers in the numberList parameter and assign the resulting sum to a new variable named total. Do not use the Math object or any other built-in JavaScript function to find the largest number. Use a for loop to find the largest number within the numberList parameter and assign that number to the largest property of the stats object (i.e. ![]() Assign an empty object to a new variable named stats. Within the function definition's code block, do the following: a. Assume the parameter will be an array of numbers. Define a function named getstats with one parameter: numberList. lo g to print the string "Array values within range". lo g to print the string "Maximum number exceeded". Use a conditional statement to check if the value of the counter variable is greater than 740. log to print the value of the numbers array. Within the loop's code block, increment the value of the counter variable by 73 and push the new value of the counter variable into the numbers array. Write a for loop that iterates a total of ten times. Assign an empty array to a new variable named numbers. ![]() Assign the number 10 to a new variable named counter. Instructions Your solution should implement this series of steps: 1. ![]()
0 Comments
Leave a Reply. |