Skip to content

Instantly share code, notes, and snippets.

@NullDev
Last active November 15, 2018 14:58
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 NullDev/cffb2a4e8f2f824b1fc49ba12bf5e06e to your computer and use it in GitHub Desktop.
Save NullDev/cffb2a4e8f2f824b1fc49ba12bf5e06e to your computer and use it in GitHub Desktop.
Global Chain function example with prototyping
Function.prototype.test = function(x){
var arg1 = this();
var arg2 = x;
console.log(
"Arg1: " + arg1 +
"\nArg2: " + arg2
);
}
function x(){
return "arg1";
}
x.test("arg2");
// Should output:
// Arg1: arg1
// Arg2: arg2
@NullDev
Copy link
Author

NullDev commented Nov 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment