Define Private field Members and Inheritance in JAVASCRIPT module pattern
问题 I can define private member fields in module pattern using the code below var myClass = function(){ var private_field1,private_field_2; var private_func1 = function(){ //....... } //......... var myObj = { global_field1:2, global_field2:\"something\", global_func: function(){//......} } return myObj; }; var obj = myClass(); This method works just fine, but the problem with this problem is that whenever I create a new object the copy of all the functions is created and loaded in memory (not