“Uncaught TypeError: undefined is not a function” - Beginner Backbone.js Application

前端 未结 3 1729
离开以前
离开以前 2020-12-23 16:47

I\'m setting up a pretty simple app with backbone, and I\'m getting an error.

Uncaught TypeError: undefined is not a function example_app.js:7
ExampleApp.ini         


        
3条回答
  •  长情又很酷
    2020-12-23 17:26

    I have occurred the same error look following example-

    async.waterfall([function(waterCB) {
        waterCB(null);
    }, function(**inputArray**, waterCB) {
        waterCB(null);
    }], function(waterErr, waterResult) {
        console.log('Done');
    });
    

    In the above waterfall function, I am accepting inputArray parameter in waterfall 2nd function. But this inputArray not passed in waterfall 1st function in waterCB.

    Cheak your function parameters Below are a correct example.

    async.waterfall([function(waterCB) {
        waterCB(null, **inputArray**);
    }, function(**inputArray**, waterCB) {
        waterCB(null);
    }], function(waterErr, waterResult) {
        console.log('Done');
    });
    

    Thanks

提交回复
热议问题