I'm currently working in a js-component and i was wondering if there's a better way to concatenate functions in javascript then returning this. I have a sample code working here, and that's how i solved the problem.
function hi(){
console.log('hi');
return this;
}
function bye(){
console.log('bye');
return this;
}
function Test(){};
Test.prototype.hi = hi;
Test.prototype.bye = bye;
var x = new Test();
x
.hi() //hi
.bye(); //bye
bye?this. Not really anything else you can do.