JavaScirpt学习(一)
js在线编辑网站:http://jsfiddle.net/
Private Members in JavaScript
http://javascript.crockford.com/private.html
JavaScript每个函数都带有一个仅在这个函数范围作用的变量arguments
function User(properties) { (function(which) {for(var i in properties){var p =i;which["get"+p] = function(){return properties[p];};which["set"+p] = function(val){properties[p]= val;};} } )(this); }var user = new User({name :"Bob",age:"44"});alert(user.name==null);alert(user.getname()=="Bob");user.setage(22);alert(user.getage()=="22");