Javascript examples for Object:Object Property
Objects with properties that are functions details about 'this'
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from ww w . ja v a 2 s . com var foo = { p1: function(){ return this.p2; }, p2: function(){ console.log('i am foo.p2'); } }; document.write("Foo.p1: <br /><pre>" + foo.p1() + "</pre>"); }); </script> </head> <body> </body> </html>