What's the point of returning a function inside a function?

clipboard.png
the function of the red box in the figure returns. How does
work?
can the function be executed by recursively calling the function itself?

Mar.19,2021

1. Returns the final result of this function, which is used to call other programs or functions.
2. Call yourself through arguments.callee


yourself, recursively! Recursion can replace loops, but loops do not necessarily replace recursion, so it is better to use recursion when necessary.


this provides flexibility in some chain programming or further processing programming based on conditions.
for example, the chained call to sum is implemented in this concrete example.

Menu