This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Please, change default code template for "for" from this: for (var ${var default="i"} = 0, ${max} = ${limit default="10"}; ${var} < ${max}; ${var}++) { ${selection}${cursor} } to this: for (var ${var default="i"} = 0; ${var} < ${max}; ${var}++) { ${selection}${cursor} } That "max" part is really annoying there ;) If you think that we need such a code template, then you can create new with e.g. abbr: "fom" which will mean "FO with Max" and put it there :) Thanks in advance!
It was originally my idea to put it there for performance reasons with common arrays. But I'm fine with "fom"
Caching array length is not as cool as it could look like [1] [2] ;) But if you are ok with "fom", then we can of course have both versions. [1] http://mrale.ph/blog/2014/12/24/array-length-caching.html [2] http://architects.dzone.com/articles/javascript-shoud-i-have-cache
Depends on the test and what are you iterating :) [1] http://jsperf.com/array-length-vs-cached
Changed in web-main as requested:).
Yep I know, that's why I didn't write that it doesn't work at all ;)) Thanks!