function sample(){ sub =new f(70,4); sub.p=200; a=sub.play(); alert(a); } class f{ constructor() { } play(){ this.z=2*this.p; return this.z; } }