|
Note that filter is also much shorter to code and test in the first place as you have only one line of code that you have written that needs testing as compared to the alternative where you have to write a lot more code including a loop.
You can easily implement filter for any of the browsers that do not yet support it by grabbing a copy of the code to add that support from the Mozilla JavaScript reference. You would not need to worry about testing that code any more than you'd need to worry about testing all the code in JQuery (if you use that JavaScript library) as the code has already been tested.
Why code and test an entire loop of code that needs to do the same thing as can already be easily done with only one line of new code.
Last edited by felgall; 12-03-2012 at 08:17 PM..
|