var foo = { a: 5, b: 6, get c() { return this.a + this.b; } } console.log(foo.c) // 11 Run code snippet