Skip to content

Instantly share code, notes, and snippets.

@evanrmurphy
Created December 28, 2010 09:23
Show Gist options
  • Save evanrmurphy/757084 to your computer and use it in GitHub Desktop.
Save evanrmurphy/757084 to your computer and use it in GitHub Desktop.
somewhat more readable than the compiled output
personUpdateSternness = (function() {
return ((this.laughter==0) ? this.sternness=true
: (this.laughter>5) ? this.sternness=null
: null),
this.sternness;
}),
personUpdateLaughter = (function() {
return (!this.sternness ? (this.laughter += 10)
: (--this.laughter,
((this.laughter < -10) ? (this.laughter += 10000)
: null))),
this.sternness;
}),
person = (function(){
return {laughter: 0, sternness: false,
updateSternness: personUpdateSternness,
updateLaughter: personUpdateLaughter};
}),
evan = person(),
ryan = person();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment