Skip to content

Instantly share code, notes, and snippets.

@shawn42
Created January 3, 2013 16:17
Show Gist options
  • Save shawn42/4444621 to your computer and use it in GitHub Desktop.
Save shawn42/4444621 to your computer and use it in GitHub Desktop.
JS attribute calling a function.
Foo = {}
Object.defineProperty(Foo, 'blah', {get: function(){ return 'yo'}});
Foo.blah
=> 'yo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment