Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 9
    Strictly speaking from the POV of "I'm an axe wielding mad-man that has the honor of taking over your code because you've moved on to bigger and better things; yet I know where you live". I really hope this isn't normal lol. Using it inside of a plug-in which you maintain, acceptable. Writing business-logic code, please hold while I sharpen my axe :) Commented Mar 11, 2016 at 22:15
  • 3
    @MonkeyZeus haha, yes! Added a disclaimer for coders of the future that can find this from Google Commented Mar 11, 2016 at 22:23
  • Actually this disclaimer is too harsh. There are legitimate use cases for "getter as a function call". In fact it's used extensively in a very successful library. (would you like a hint?? :-) Commented Mar 12, 2016 at 23:48
  • 1
    Note that __defineGetter__ is deprecated. Use Object.defineProperty instead. Commented Mar 13, 2016 at 19:33
  • 2
    @MonkeyZeus - as I explicitly wrote in the comment - this style of function invocation is being used, extensively & intentionally, in a very successful public library as the API itself, not internally. Commented Mar 14, 2016 at 23:00