var tmp = ‘1,6,6,7,7,8,2,3,3,4,4,5‘; var tmpJson = {}; $.each(tmp.split(‘,‘), function(i, n){ tmpJson[‘a‘+n] = n; }); var tmpArr = []; $.each(tmpJson, function(i,n){ tmpArr.push(n) }); console.log(tmpArr.sort())
时间: 2024-11-03 03:33:30
var tmp = ‘1,6,6,7,7,8,2,3,3,4,4,5‘; var tmpJson = {}; $.each(tmp.split(‘,‘), function(i, n){ tmpJson[‘a‘+n] = n; }); var tmpArr = []; $.each(tmpJson, function(i,n){ tmpArr.push(n) }); console.log(tmpArr.sort())