# Pick an element from array

**URL:** <https://forum.kirupa.com/t/pick-an-element-from-array/331532>\
**Category:** Uncategorized\
**Created:** [August 20, 2013, 9:05pm UTC](https://forum.kirupa.com/t/pick-an-element-from-array/331532 "2013-08-20T21:05:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sofia123](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@sofia123](https://forum.kirupa.com/u/sofia123)\
**Post date:** [August 20, 2013, 9:05pm UTC](https://forum.kirupa.com/t/pick-an-element-from-array/331532/1 "2013-08-20T21:05:32Z")

</div>

[SIZE=4]Hello  
I have a question about array  
if I have the following array for example:  
letters=new Array()  
letters[0]=“a”  
letters[1]=“b”  
letters[2]=“c”  
how can I pick a random element from above array without repetition?  
If I use random.math() function , I will get a random element but with repetition.  
to explain my idea in more details:  
i have button(b) and a dynamic text(t)… i want **one** and only one **random&unique** element from the array appears in the dynamic box(t) every time i press the button(b)  
Note: I tried to use shuffle array that i found in some websites but the problem is that all elements(a,b,c) appear in the dynamic box in the same time.  
i am really confused!  
any help will be appreciated[/SIZE]
