var str = "1,2,4,5,2,4"; var s = str.split(','); var dic = {}; for (var i = s.length; i--; ) { dic[s[i]]=s[i]; } var r = []; for (var v in dic) { r.push(dic[v]); } alert(r.join());
Powered by: 博客园 Copyright © 2024 人生梦想起飞 Powered by .NET 9.0 on Kubernetes