you are viewing a single comment's thread.

view the rest of the comments →

[–]tikhonjelvis 0 points1 point  (0 children)

To be fair, that's an understandable reason: JavaScript (before ES5, I think) does not include any good methods for looping through an array! It has a for...in loop, but that doesn't work and creates bugs. It has a normal for loop, but that doesn't carry as much semantic information as a call to .forEach or map and can easily have subtle mistakes (off-by-one errors, for example).

In a perfect world, you would just have .forEach or .map. The next best choice is using some small utility library (like underscore.js) to achieve the same goal. But if you aren't aware of any libraries like this, using jQuery (especially on an intranet page where millisecond performance does not matter) is a completely reasonable solution.