# Find consecutive array elements

**URL:** <https://forum.kirupa.com/t/find-consecutive-array-elements/299557>\
**Category:** flash\
**Created:** [November 6, 2009, 6:05pm UTC](https://forum.kirupa.com/t/find-consecutive-array-elements/299557 "2009-11-06T18:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaunas](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Kaunas](https://forum.kirupa.com/u/Kaunas)\
**Post date:** [November 6, 2009, 6:05pm UTC](https://forum.kirupa.com/t/find-consecutive-array-elements/299557/1 "2009-11-06T18:05:43Z")

</div>

What’s the most effective way to find a number of consecutive elements in an array?

To keep this really basic, if I had something like:

var array:Array = [0,1,0,1,1,1,0];

What would be the best way to detect the three consecutive 1s?

I have been playing arround with array.some() but it ain’t really working out 🙂
