News for hackers. Stuff that matters.
Re:Calling an Array of Functions in JavaScript by serve_yay on Monday December 01, 2014 @02:01PM (#8682931)
Sure, I'm just making the point that sometimes when you look at something like that and think it can be improved, it's worth considering that the cure may end up being worse than the disease.
Re:Calling an Array of Functions in JavaScript by zpao on Monday December 01, 2014 @02:34PM (#8683150)
It is worth considering, but it's often worth finding out what the cure is before writing it off. You have to make the right tradeoffs (eg, when working on a tight deadline, it's probably not the right call to go off into the weeds finding out if you can make 3 lines of code into 1).
Re:Calling an Array of Functions in JavaScript by baddox on Monday December 01, 2014 @09:46PM (#8685400)
Sometimes, yes. And sometimes not. If, for instance, the author would have discovered that forEach worked differently, and there was some function that JS provides that worked cleanly with a readable name, then the article could have concluded that it makes sense to use that.