Question: add your own properties to them that will persist between function invocations, use a function statement to write a similarly self-contained function named runningAverage that
add your own properties to them that will persist between function invocations, use a function statement to write a similarly self-contained function named runningAverage that expects a single parameter. If the value of that parameter is numeric (or may be coerced into something numeric), add it to the running sum and count stored by the function and return the current value of all the arguments passed since the runningAverage function was last called with a non-numeric value. When invoked with a non-numeric parameter, the function should reset its stored count and sum to 0 and return a value of NaN. Once properly tested, provide your source code for this function and the code you used to test it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
