Created
February 6, 2019 13:04
-
-
Save moltar/e322a54f2834bca9747531eb44fa4c15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
get a() { | |
return 1 | |
} | |
} | |
class B { | |
get b() { | |
return 2 | |
} | |
} | |
class Foo { | |
constructor(private hey: boolean = true) { } | |
get foo() { | |
return this.hey ? new A() : new B(); | |
} | |
} | |
const foo = new Foo() | |
const loo = foo.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment