AS3 Array Difference


/ Published in: ActionScript 3
Save to your folder(s)

vLarger - Larger array
vSmaller - Smaller array


Copy this code and paste it in your HTML
  1. function fDifference(vLarger : Array, vSmaller : Array) : Array
  2. {
  3. var i : int;
  4. var vList : Array = new Array();
  5.  
  6. for (i = 0; i < vLarger.length; i++)
  7. if (vSmaller.indexOf(vLarger[i]) == -1)
  8. vList.push(vLarger[i])
  9. return vList;
  10. }

URL: http://simplistika.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.