Define the child function outside of the main function. Call the child function to multiple places as your need.
Of course, you need that to be called in function1()
and call any other places as you like.
function1(){
this.function2();
}
function2(){
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…