# Removing from an Array

**URL:** https://forum.kirupa.com/t/removing-from-an-array/167426
**Category:** flash
**Created:** [October 28, 2005, 2:34am UTC](https://forum.kirupa.com/t/removing-from-an-array/167426 "2005-10-28T02:34:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RavenStorm](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@RavenStorm](https://forum.kirupa.com/u/RavenStorm)
#### Post date: [October 28, 2005, 2:34am UTC](https://forum.kirupa.com/t/removing-from-an-array/167426/1 "2005-10-28T02:34:19Z")

</div>

Really simple question.

Let’s say I wanted to randomly remove an item from an array in a for loop.

Basically, it would go something like;

thearray = [“lol”, “dude”, “ROFL”, “lame”, “excellent”]  
for (i=0; i\<4; i++) {  
randomness = random(thearray.length())  
thearray.remove [randomness]  
}

Obviously that last line was made up, that’s where the code goes for the item-removal.

Thanks a lot guys,  
-Raven~Storm
