3 ms·
I wished I could have `for...of` loop to iterate array in javascript, so I can say goodbye to `for(var i=0;i<len;i++)`. Now it's supported by all browsers. But
by c_shu 10y ago
I wished I could have `for...of` loop to iterate array in javascript, so I can say goodbye to `for(var i=0;i<len;i++)`. Now it's supported by all browsers. But it's so late. You cannot use it unless you only support very recent browsers.
- ludamad 10y agoNot true, you can use typescript and have it along with stays-out-of-your-way static typing, or only test in modern browsers and cross compile later.
- c_shu 10y agoThat's another language. You can prefer Java. You can prefer TypeScript. They are just not JavaScript. (Nowadays there are so many source-to-source compilers to JavaScript. Even Java-to-Javascript compiler.)
- ludamad 10y agoWhat additions that TypeScript has do you find offensive? And that's why I gave my second option, which allows you to use modern JavaScript natively (without the additional features TypeScript has, if so opposed) and cross-compile when you have to target older platforms.