A clearer explanation for recursion and flow of execution in JavaScript?

后端 未结 3 700
小蘑菇
小蘑菇 2020-11-29 09:54

I was reading Eloquent JavaScript and I came across this example for the puzzle:

Consider this puzzle: By starting from the number 1 and repeatedly

3条回答
  •  时光取名叫无心
    2020-11-29 10:17

    If I'm understanding your question correctly: The final line of code is calling findSequence(), with a goal of 24. In findSequence() there's a function called find(), which is defined and then called in the return statement for findSequence, with start equaling 1, and history equaling 1.

提交回复
热议问题