Node.js examples for Object:Object Operation
Methods are functions that have the `this` bonus param assigned to the object that the method was called on.
/**//from ww w. java 2 s .com * Objects have properties and methods * * Methods are functions that have the `this` bonus param assigned to * the object that the method was called on. */ function sayHello(){ console.log("Regular ol' function call", this); } sayHello(); var zuri = { name: 'Zuri', sayHello: function(){ console.log('method function call. This:', this); } }; zuri.sayHello();