Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this is (of course) a horrible simplification
- // but assume that all objects have something like this...
- function _get_set(prop, value){
- if(typeof(value) !== "undefined"){
- this['_' + prop] = value;
- }
- return this['_' + prop])
- }
- thing = {
- height: function(value){ _get_set('height', value) }
- width: function(value){ _get_set('width', value) }
- }
Add Comment
Please, Sign In to add comment