var BaiduUsers = [] var UserArray = function(name, phone, id, id2) { this.name = name; this.phone = phone; this.id = id; this.id2 = id2; }; User.add = function(name, phone, id, id2) { return new UserArray(name, phone, id, id2); }; BaiduUsers.push(User.add('tommy', '1111',undefined , 10000)); BaiduUsers.push(User.add('jerry', '2222', 28, 10000)); BaiduUsers.push(User.add('raobin', '3333', 14, 1200));