Javascript examples for Object:Object Property
Call function when calling object without method
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w ww . j av a 2 s .c o m var test = function() { console.log('hello'); return { moo : function() { console.log('moo'); } } }; var obj = test(); obj.moo(); } </script> </head> <body> </body> </html>