performance - for...of - JavaScript keyword Internet Explorer work-around -
i using “for...of” in many places in javascript code new technology, part of javascript’s new specification (ecmascript 2015 (e56) standard). "for...of" supported in chrome, safari , firefox. though, ie doesn’t yet support new feature (see link). best approach support these 4 main browsers - revert "for in/for loop" or use browser-sniffing code or there better hack able both use hybrid "for...of" , "for...in"? not repeat of question here: link_here because aware ie not support "for...of". looking if there hack still use , still support 4 browsers listed?
you can add traceur compiler:
<script src="https://google.github.io/traceur-compiler/bin/traceur.js"></script> <script src="https://google.github.io/traceur-compiler/src/bootstrap.js"></script> <script type="module"> for(var n of ['foo', 'bar']) alert(n); </script>
it should work on ie9.
Comments
Post a Comment