var point = {x: 10, y: 11, sph: function(){ return Math.sqrt(this.x*this.x+this.y*this.y) }} console.log(point.sph());