I'm creating functions which are being chaining like jQuery with prototype like this:
String.prototype.rem = function (toRemove){
return this.replace(toRemove,'');
}
var str = 'aaaasaaaa';
console.log(str.rem('s'))
That's only an example.
My question is that, is it true way to define chaining function. Or am I doing it wrong?