Last active
January 5, 2017 16:23
-
-
Save imiroslavov/6b70ec05a0036e1de9a3714a13528c9a to your computer and use it in GitHub Desktop.
Monkey-patching javascript 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 function_name() { | |
console.log('function_name'); | |
} | |
var original_function = function_name; | |
function_name = function() { | |
console.log('pre'); | |
var result = original_function.apply(this, arguments); | |
console.log('post'); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment