zoukankan      html  css  js  c++  java
  • jquery去重

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <script>
    var arr=["andkin","张洪庆","王齐文","关白","杜丽红","Harry","秦利","zxuan1988","→_→乐在途中←_←","","一生无悔<span class="emoji emoji1f48b"></span>","星空","Cai","diaduoduo","ricky","梅子","a叫军哥<span class="emoji emoji2755"></span><span class="emoji emoji1f48b"></span>","...","wish","foge","Flea","广广","♂pine&nbsp;nutぁ","Alan","阅读:次","DreamLife","杨润辉","胖娃儿","pab","swone","","曹文进","小空气","欧阳文龙","Star•Li","pray","希洛","王晓玲","欣欣","龙丰","冰icejie&nbsp;洁","王志伟","鏉梓","兰戈","","xue骤雨","jimmy","文龙","JAK","Caven","潘洪雪","朋巧","&nbsp;潘&nbsp;龙瑞","郑创","sayid","","<span class="emoji emoji2665"></span>℡其实还没有她!","arvinrenamed","吖木"];
    
    var json={};
    
    var aResult=[];
    
    for(var i=0;i<arr.length;i++)
    {
        if(!json[arr[i]])
        {
            aResult.push(arr[i]);
            json[arr[i]]=1;
        }
    }
    
    /*Harry:1
    andkin:1
    zxuan1988:1
    →_→乐在途中←_←:1
    关白:1
    张洪庆:1
    彪:1
    杜丽红:1
    王齐文:1
    秦利:1*/
    
    document.write(JSON.stringify(aResult));
    </script>
    </head>
    
    <body>
    </body>
    </html>
  • 相关阅读:
    Bzoj 2820: YY的GCD(莫比乌斯反演+除法分块)
    Cogs 2221. [SDOI2016 Round1] 数字配对(二分图)
    Cogs 750. 栅格网络(对偶图)
    最小环问题
    浅谈卡特兰数
    洛谷 P1744 采购特价商品
    HDU 1212 Big Number
    HDU 2108 Shape of HDU
    HDU 1029 Ignatius and the Princess IV
    HDU 1021 Fibonacci Again
  • 原文地址:https://www.cnblogs.com/yaowen/p/5705439.html
Copyright © 2011-2022 走看看