javascript return of recursive function

前端 未结 4 1925
别那么骄傲
别那么骄傲 2020-12-06 11:22

Hate to open a new question for an extension to the previous one:

function ctest() {
    this.iteration = 0;
    this.func1 = function() {
        var result         


        
4条回答
  •  清歌不尽
    2020-12-06 11:33

    You have to return all the way up the stack:

    func2.call(this, sWord);
    

    should be:

    return func2.call(this, sWord);
    

提交回复
热议问题