Skip to content

Instantly share code, notes, and snippets.

@dandean
Created February 8, 2010 22:17
Show Gist options
  • Select an option

  • Save dandean/298644 to your computer and use it in GitHub Desktop.

Select an option

Save dandean/298644 to your computer and use it in GitHub Desktop.
// this:
styleSet.each(this.add, this);
// is the same as this:
styleSet.each(function(s) {
this.add(s);
}, this);
// The first one is not only shorter, but speedier
// because it has one less function in its closure chain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment