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
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