function Student() { this.obj = {}; this.setName = function(name) { this.obj.name = name; return this; }; this.setAge = function(age) { this.obj.age = age; return this; }; this.get = function() { console.log(this.obj); }; } let student1 = new Student(); student1 .setName('pravin') .setAge(25) .get()
