Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created August 29, 2019 08:57
Show Gist options
  • Save tkssharma/2e0a6de5db0c170a10606209a3f5ae23 to your computer and use it in GitHub Desktop.
Save tkssharma/2e0a6de5db0c170a10606209a3f5ae23 to your computer and use it in GitHub Desktop.
var Object = {
x : 90
}
Object.defineProperty(Object,'getVal',{
get : function(){
return this.x;
},
set : function(x){
this.x = x;
},
enumerable : true,
configurable : true
})
class Hello {
private _x: String = null;
get Message(){
return this._x;
};
set Message(x){
this._x = x
};
}
var Hello =/* class */ (function(){
function Hello(){
this._message = null
}
Object.defineProperty(Hello.prototype,'Message',{
get : function(){
return this._message
},
set : function(msg){
this._message = msg;
},
enumerable : true,
configurable : true
})
return Hello;
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment