Posted By

nuwak on 10/30/10


Tagged

array


Versions (?)

Удаление дубликатов из массива


 / Published in: JavaScript
 

  1. function removeDuplicateElement(arrayName)
  2. {
  3. var newArray=new Array();
  4. label:for(var i=0; i<arrayName.length;i++ )
  5. {
  6. for(var j=0; j<newArray.length;j++ )
  7. {
  8. if(newArray[j]==arrayName[i])
  9. continue label;
  10. }
  11. newArray[newArray.length] = arrayName[i];
  12. }
  13. return newArray;
  14. }

Report this snippet  

You need to login to post a comment.