Posted By

mattkenefick on 05/19/08


Tagged

array unique make


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mattkenefick


Array: Unique


 / Published in: ActionScript
 

Remove Duplicates from Array

  1. Array.prototype._unique = function() {
  2. /*
  3. * Kills duplicates in an array
  4. */
  5.  
  6. var obj={}, i=this.length, arr=[],t;
  7. while(i--)
  8. t=this[i],obj[t]=t;
  9.  
  10. for(i in obj)
  11. arr.push(obj[i]);
  12.  
  13. return arr;
  14. };// End Function

Report this snippet  

You need to login to post a comment.