Created
September 27, 2018 04:32
-
-
Save romero126/3d91e3de899abb53409094c9e9d453e0 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 foo { | |
private _bar:boolean = false; | |
get bar():boolean { | |
return this._bar; | |
} | |
set bar(theBar:boolean) { | |
this._bar = theBar; | |
} | |
} | |
var myFoo = new foo(); | |
if(myFoo.bar) { // calls the getter | |
myFoo.bar = false; // calls the setter and passes false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment