AS3 Remove an element from an array


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



Copy this code and paste it in your HTML
  1. var myArray:Array = new Array("a", "b", "c", "d", "e", "f");
  2. trace(myArray);
  3. myArray.splice(myArray.indexOf("c"), 1);
  4. trace(myArray);
  5.  
  6. // OUTPUT
  7. // a,b,c,d,e,f
  8. // a,b,d,e,f

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.