RecListProc1.init() RecListProc1.args RecListProc1.functionDefinition RecListProc1.functionCalls RecListProc1.correct RecListProc1.incorrect[0] RecListProc1.incorrect[1] RecListProc1.incorrect[2]

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.

CorrectAnswer
  • option1
  • option2
  • option3

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.