This is really a chain of methods. parseFloat
returns a Number object
that has a toFixed
method.
This is a basic example showing how it works:
function Construct(){ this.method1 = function(){ return this; }; this.method2 = function(){ alert('called method2'); return this; }; this.method3 = function(){ alert('method3: I am not chainable'); }; } var instance = new Construct; instance.method1().method2().method3();
source share