var arr = [\'test0\',\'test2\',\'test0\'];
Like the above,there are two identical entries with value \"test0\",how to check it most efficiently?
var index = myArray.indexOf(strElement); if (index < 0) { myArray.push(strElement); console.log("Added Into Array" + strElement); } else { console.log("Already Exists at " + index); }