垃圾弟弟

<html>
<head>
</head>
<body>
<form name=form1>
<input name=a123>
<input name=b123>
<input name=c123>
<input name=d123>
<input name=e123>
<input name=f123 type=button onclick=check()>
</form>
<SCRIPT LANGUAGE="JavaScript">
Array.prototype.unique1 = function()
{
   var a = {};
 var len = 0;
 for(var i=0; i<this.length; i++)
   {
  //alert('号码:'+i);
  //alert('初始:'+a[this[i]]);
  //alert(this[i]);
     if(typeof a[this[i]] == "undefined")
  {
        a[this[i]] = 1;
   len +=1;
  }
  
  //alert('结束:'+a[this[i]]);
 }
 
  this.length  = len;
  //for(var i in a)
     //this[this.length] = i;
   return this;
}
function check()
{
  var ArrText = [document.form1.a123.value,document.form1.b123.value,document.form1.c123.value,document.form1.d123.value,document.form1.e123.value];
 OldArr=ArrText.length;
 //alert(ArrText.unique);
 //NewArr=ArrText.prototype;
  NewArr=ArrText.unique1().length;
  if(OldArr==NewArr)
  {
    alert("无");
 }
  else
  {
   alert("有");
 }
}
</SCRIPT>
</body>
</html>
 

static bool trystore(string[] test)
        {
            for (int i = 0; i < test.Length; i++)
            {
                for (int f = i+1; f < test.Length; f++)
                {
                    if (test[i] == test[f])
                        return true;
                }
            }
            return false;
        }

原文地址:https://www.cnblogs.com/zwei1121/p/1050155.html