call to a function that inside another function in JavaScript

前端 未结 4 1204
旧巷少年郎
旧巷少年郎 2020-12-12 07:50

I want to call a function that is in another function.

example for the functions:

function funcOne() {
     function funcTw         


        
4条回答
  •  抹茶落季
    2020-12-12 08:18

    Reading some Douglas Crockford may help you understand...

    Try recoding as:

    function funcOne() {
       this.funcTwo = function() {
       }
    }
    

    I think you'd have to declare an instance of a funcOne object and then call the funcTwo method of that object. I'm a bit busy at the moment so I can't refine this answer at the moment.

提交回复
热议问题