Skip to content

Instantly share code, notes, and snippets.

@ryanstevens
Created December 21, 2011 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanstevens/1505201 to your computer and use it in GitHub Desktop.
Save ryanstevens/1505201 to your computer and use it in GitHub Desktop.
This shows you can pass arguments directly into apply
var test = require("testling")
test("Apply arguments", function(t) {
function fn(p1, p2) {
t.equal(p1, 10);
t.equal(p2, 20);
}
function caller() {
fn.apply(null, arguments);
}
caller(10, 20);
t.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment