# Return randomized array...help

**URL:** <https://forum.kirupa.com/t/return-randomized-array-help/85356>\
**Category:** Uncategorized\
**Created:** [April 4, 2005, 4:15am UTC](https://forum.kirupa.com/t/return-randomized-array-help/85356 "2005-04-04T04:15:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonfly](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dragonfly](https://forum.kirupa.com/u/dragonfly)\
**Post date:** [April 4, 2005, 4:15am UTC](https://forum.kirupa.com/t/return-randomized-array-help/85356/1 "2005-04-04T04:15:50Z")

</div>

can someone show me a simple “randomize array” function. maybe a prototype that just returns a randomized version of an array such as:

array = [1,2,3,4,2]  
array.randomize;  
trace(array) // traces 5,1,4,3,2 or whatever.

I started on one myself but got stuck when, in the prototype, looping through “this” also counted the function being passed, as well as the elements of the array, and i can’t seem to remember why it does that.

Thanks
