代码如下:var as = [1,2,11,3434,3,4545,33,55,0];as.sort(); //这个排序是按照字典排序//自定义按照数字排序function sortByNum(a,b){return parseInt(a) – parseInt(b);}as.sort(sortByNum);//按照对象来排序//定义一个person对象function Person(name.age){this.name=name;this.age=age;}var p1 = new Pers