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