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*

10
  • 2
    I wasn't necessarily thinking only attribute evaluation - for example, take the attribute Winged. That might give its possessor the fly() method. Commented Jul 18, 2013 at 0:08
  • this.fly = function(){ if( this.isWinged && !this.isFat ){ ... } }; Commented Jul 18, 2013 at 0:19
  • or this.fly = ( this.isWinged && !this.isFat ) ? function(){...} : null; Commented Jul 18, 2013 at 0:20
  • 1
    Writing an else condition in for the first one would be the part I'd enjoy. Commented Jul 18, 2013 at 0:22
  • 2
    Hint: if you put <!-- language: lang-javascript --> before your code block, it will highlight it for javascript. See Manually specify language for syntax highlighting for the language list and Language hint for the code environment for a better demonstration of how to use it. Commented Aug 6, 2013 at 17:08