What is the best way to implement method chaining in javascript?
function CONSTRUCT(){
this.func1=function(insert_ob){insert_ob.appendTo=this;/*other code*/};
this.func2=function(...){};
this.func3=function(...){};
}
function My_Object_Creator(){this.appendTo=null;}
object1=new CONSTRUCT();
my_object=new my_Object_Creator();
object1.func1(my_object).func2().func3();
I know I can adjust those functions to in the constructor to achieve it but I want to know if there are some well-known methods or patterns one should follow while creating method chaining possibility in javascript?