Skip to content

Instantly share code, notes, and snippets.

@shawn42
Created January 3, 2013 16:17
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 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