Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Created August 14, 2016 21:02
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 saltukalakus/a07777b2836b9a18fff008c294e5cdfa to your computer and use it in GitHub Desktop.
Save saltukalakus/a07777b2836b9a18fff008c294e5cdfa to your computer and use it in GitHub Desktop.
js call
function personContainer() {
var person = {
name: "James Smith",
hello: function() {
console.log(this.name + " says hello " + arguments[1]);
}
}
person.hello.apply(person, arguments);
}
personContainer("world", "mars"); // output: "James Smith says hello mars", note: arguments[0] = "world" , arguments[1] = "mars"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment