1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class Foo { constructor() { this.bar = 5; } } let x = new Foo(); x.bar; // ^ defined: 3 class Bar { constructor(x) { this.field = x; } } let bar = new Bar({ baz: 5 }); bar.field.baz // ^ defined: 17