Javascript examples for Object:Constructor
Check this reference in child object
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from www. j a v a2 s .c o m*/ function Child() { this.method = function() { console.dir(this); }; } function Parent() { this.child = new Child(); } var p = new Parent(); p.child.method(); p.child.method.call(p); } </script> </head> <body> </body> </html>