# Get average of array?

**URL:** <https://forum.kirupa.com/t/get-average-of-array/225413>\
**Category:** flash\
**Created:** [May 11, 2007, 2:56pm UTC](https://forum.kirupa.com/t/get-average-of-array/225413 "2007-05-11T14:56:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dru\_nasty](https://avatars.discourse-cdn.com/v4/letter/d/90db22/32.png) [@dru\_nasty](https://forum.kirupa.com/u/dru_nasty)\
**Post date:** [May 11, 2007, 2:56pm UTC](https://forum.kirupa.com/t/get-average-of-array/225413/1 "2007-05-11T14:56:53Z")

</div>

I’ve got an quiz game with 8 questions. Each question has 5 possible answers. When clicking one of the answers (say it’s answer #3) it adds 3 as the element. So say you pick answer #1 for the first 3 questions, then answer number 2 for the last 5 questions the array looks like this:

```auto
scoreArray = (1, 1, 1, 2, 2, 2, 2, 2);

```

I want to show a result based on the answer picked the most. So how do I pull the “most picked” answer from the array?

I’m going to use that to send the playhead to a certain frame 😉

Thanks!!
