Created
August 16, 2015 22:57
-
-
Save spmurrayzzz/562be47cd973a5398793 to your computer and use it in GitHub Desktop.
js13kgames closure fun
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
(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