Javascript examples for Function:Function Nest
override a Javascript function inside another function?
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w .j a v a 2 s. c om var parentMethod = { someOtherMethod: function() { console.log("Am someone") }, childMethod: function() { console.log("Am Child") } }; parentMethod.childMethod(); parentMethod.childMethod = function() { console.log("Am Child New") }; parentMethod.childMethod(); } </script> </head> <body> </body> </html>