On my current project we’ve been working heavily with backbone.js and underscore.js. We were recently bit by a bug where all of our automated tests in Firefox and our manual tests in Firefox and Chrome passed.
We discovered the problem was a forgotten call to underscore the array returned by underscore’s
# broken _(candies).filter((candy) -> candy.isChocalate? ).map (candy) -> candy.yummy() # plays well with IE8 _(_(candies).filter((candy) -> candy.isChocalate? )).map (candy) -> candy.yummy() # allows for more method chaining _(candies).chain().filter((candy) -> candy.isChocalate? ).map((candy) -> candy.yummy() ).value()
If IE 8 is a target browser for your project, don’t forget to bring a
map (from underscore.js).
Thanks, this post saved me a lot of work on this exact error I was having in IE8.
Great article, you save my day! Thanks!
Thanks Aleksey, glad we could help.
Seriously, thank you! Been banging my head against the wall and this was the issue…
it’s amazing how easily this problem can slip into your code unnoticed for so long.
Comments are closed.