This might be useful :) #1

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

yields commented Nov 2, 2012

this pull request "saves" us from having to set defaults on object initialization and such..

so instead of

var Agent = function () {
   this.set('ua', 'chrome');
}

Agent.prototype.dostuff = function () {
  var ua = this.get('ua');
};

we can simply:

Agent.prototype.dostuff = function () {
   var ua = this.get('ua', 'chrome');
};

I know we can use || but sometimes the default value can be falsey....

yields commented Dec 5, 2012

I'm guessing this should be closed.. :)

@yields yields closed this Dec 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment