Try to write all of the exercises using both the for
loop and while
loop.
function each(coll, func) {
-
Write a function called
average
that takes an array of numbers as a parameter and returns the average of those numbers.After you write your function, you can test it using the above inputs to make sure that it behaves correctly.
-
Write a function called
min
that finds the smallest number in an array of numbers.