<html> <head> <script> function Point(x,y){ this.x=x; this.y=y; } var p=new Point(1,2); console.log(p.x); console.log(p.y); Point.prototype.r=function(){ return Math.sqrt(this.x*this.x+ this.y*this.y); }; //window.print(p.r()); document.write(p.r()); </script> </head> <body> <div> I am a good girl </div> </body> </html>