Python Method Chaining In Javascript