# Performance with for...in loops

**URL:** https://forum.kirupa.com/t/performance-with-for-in-loops/322634
**Category:** Uncategorized
**Created:** [May 27, 2011, 5:39pm UTC](https://forum.kirupa.com/t/performance-with-for-in-loops/322634 "2011-05-27T17:39:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Josh\_Martin](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@Josh\_Martin](https://forum.kirupa.com/u/Josh_Martin)
#### Post date: [May 27, 2011, 5:39pm UTC](https://forum.kirupa.com/t/performance-with-for-in-loops/322634/1 "2011-05-27T17:39:00Z")

</div>

So this is an odd question…  
In AS3, when you do a for… in loop, the iterator is of type String…  
That does mean when your indexing into a Vector (or what ever) it has to cast to the appropriate type (Number?) does it not?..

Am I correct in saying that it’s faster to use a for loop w/ conditionals and an iterator of type Number, and then I assume faster still to use a simple while loop?
