Created
May 19, 2011 15:14
-
-
Save kaaes/980990 to your computer and use it in GitHub Desktop.
apply and call example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
el.onclick = function(evt) { | |
addStyle.call(this, '#f00', 'solid 2px blue'); | |
} | |
// both will have identical effect | |
el.onclick = function(evt) { | |
addStyle.apply(this, ['#f00', 'solid 2px blue']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment