Javascript examples for Object:Private Member
Use this or object name to reference the parent 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 var Obj = { foo : 'value', bar : function() { console.log(this.foo); }, //bar : function() { return Obj.foo; } } Obj.bar(); }); </script> </head> <body> </body> </html>