Skip to content

Instantly share code, notes, and snippets.

@demoive
Last active December 10, 2015 22:08
Show Gist options
  • Save demoive/4500041 to your computer and use it in GitHub Desktop.
Save demoive/4500041 to your computer and use it in GitHub Desktop.
Snippet - Code Injection Injects some new code to the end of a pre-existing function, essentially redefining it.
if (typeof(MYFUNC) === "function") {
eval(String(MYFUNC).replace(/\}\s*$/, ";NEWCODE;}"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment