Consider the following definition of the function f, where args:
var fp = require('./fp'); functionDefinition
Now consider the following sequence of
invocations of the
function f:
functionCalls
What values are returned assuming that these invocations of f are made in the order given above? Note that, if a given invocation throws an exception or goes into an infinite loop, the correct answer is the word "error" in all lowercase letters.
Identify the base and recursive cases.
Make the recursive "leap of faith".
You may want to trace each function call on paper, keeping track of each recursive call.