Javascript examples for Object:Constructor
Creating an object with a constructor and named members
<html> <head> <title>so</title> </head> <body> <script> function fn(arg){//w ww .j ava 2s . c o m var init = arg; return { meth:function(arg){ console.log(init + arg); } }; }; var obj = fn('hi'); obj.meth('asdf'); </script> </body> </html>