# JS: Static analyzer optimizes away iterators

**URL:** <https://community.haxe.org/t/js-static-analyzer-optimizes-away-iterators/2376>\
**Category:** Haxe\
**Tags:** haxe-js\
**Created:** [April 20, 2020, 1:52pm UTC](https://community.haxe.org/t/js-static-analyzer-optimizes-away-iterators/2376 "2020-04-20T13:52:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cambiata](https://community.haxe.org/user_avatar/community.haxe.org/cambiata/32/61_2.png) [@cambiata](https://community.haxe.org/u/cambiata)\
**Post date:** [April 20, 2020, 1:52pm UTC](https://community.haxe.org/t/js-static-analyzer-optimizes-away-iterators/2376/1 "2020-04-20T13:52:29Z")

</div>

Notices that the static analyzer quite often optimizes away iterators:  
“TypeError: it.iterator is not a function”

Disabling the static analyzer solves the problems.  
Is this a known issue? Best way to deal with it?

---

<div class="post-metadata">

**Author:** ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)\
**Post date:** [April 20, 2020, 2:17pm UTC](https://community.haxe.org/t/js-static-analyzer-optimizes-away-iterators/2376/2 "2020-04-20T14:17:53Z")

</div>

That might be a sign of a compiler issue. Could you create a sample?
