Last active
December 23, 2015 11:19
-
-
Save fschwiet/6627425 to your computer and use it in GitHub Desktop.
Quick reference for Javascript's apply, call and related functions.
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
Function.prototype.apply(thisArg[, argsArray]) | |
Function.prototype.call(thisArg[, arg1[, arg2[, ...]]]) | |
Q.nfcall(FS.readFile, "foo.txt", "utf-8"); | |
Q.nfapply(FS.readFile, ["foo.txt", "utf-8"]); | |
Q.ninvoke(FS, "readFile", "foo.txt", "utf-8"); | |
Q.npost(FS, "readFile", ["foo.txt", "utf-8"]); | |
Q.nbind(FS.readFile, FS)("foo.txt", "utf-8"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment