Question: Write a function called counter using function declaration notation with the following parameters & return value: Parameters: This function has no parameters. Return value: A

Write a function called "counter" using function declaration notation with the following parameters & return value: Parameters: This function has no parameters. Return value: A new function that returns a single number - one (1). However, every time this function is invoked (called) in the future, this function will return a number that is one greater than the previous time it was invoked (called). For example: var count = counter));//call the "counter" function and assign the return value (function) to count count();//returns 1; count();//returns 2; count));//returns 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
