var Rank1 = $('.rank').children('*:nth-child(1)').find('.rankLis span').text();
   var Rank2 = $('.rank').children('*:nth-child(2)').find('.rankLis span').text();
   var Rank3 = $('.rank').children('*:nth-child(3)').find('.rankLis span').text();
   var Rank4 = $('.rank').children('*:nth-child(4)').find('.rankLis span').text();
        console.log(Rank1)
        console.log(Rank2)
        console.log(Rank3)
        console.log(Rank4)
         
        //判断几个字符串是否有重复
        var ary = new Array(Rank1,Rank2,Rank3,Rank4);
        var nary=ary.sort();
        for(var i=0;i<ary.length;i++){
            if (nary[i]==nary[i+1]){
            console.log("数组重复内容:"+nary[i]);
        }

参考链接:https://zhidao.baidu.com/question/692544747795585524.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2022-02-15
  • 2021-08-17
  • 2021-12-24
  • 2021-12-12
  • 2021-08-09
相关资源
相似解决方案