摘要: 在javascript中,对象实际上就是一个哈希表,比如下面这个user对象:function user(n, a){ this.name = n; this.age = a; this.toString = function() { return "Name:" + this.name + ", Age:" + this.age; }}var u = new user("tom", 18);for (var k in u) { alert('key: ' + k + ', value:' + u[k] 阅读全文
posted @ 2013-01-07 16:23 allexwang 阅读(542) 评论(0) 推荐(0) 编辑