Skip to content

Instantly share code, notes, and snippets.

@spmurrayzzz
Created August 16, 2015 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spmurrayzzz/562be47cd973a5398793 to your computer and use it in GitHub Desktop.
Save spmurrayzzz/562be47cd973a5398793 to your computer and use it in GitHub Desktop.
js13kgames closure fun
(function() {
var score = 0;
Object.defineProperty( this, 'score', {
get: function(){
return score;
},
set: function( val ) {
score = val;
this.elem.innerHTML = _.template(
tmplStr, { score: score }
);
}
});
}).call( this );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment