function ff(){ var sArray = ['a','b','b','b','b','b','d','b']; var iSet = {}; for(var i=0;i<sArray.length;i++){ if(iSet[sArray[i]] == undefined){ iSet[sArray[i]] = sArray[i]; } } console.dir(iSet); }
打印结果:
posted on 2016-08-06 07:18 zno2 阅读(110) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 zno2 Powered by .NET 8.0 on Kubernetes