how to make underscore js map() working with IE8

Edit

I was bother by a bug since yesterday. It took me sometime to figure out the cause of an IE 8 error (yeah, IE again!!). It turned out it was the map() function from underscore js which made IE 8 throwing error. I have checked on IE 10 , there was no such problem!

The code IE8 didn't like was

var totalValues = _.pluck(result, "totalValues").map(format);  //format is a function
 After some testing and googling, I found the solution to be 

var totalValues = _.map(_.pluck(result, "totalValues"), format);
Previous I was complaining why there were so many syntax in underscore js to do the same thing. Now I know the reason. It is always the problematic IE! I really have to thank Microsoft constantly reminds me and all the non tech people how valuable a tech person is in the world of IE!
how to make underscore js map() working with IE8 how to make underscore js map() working with IE8 Reviewed by DF on 12:50:00 AM Rating: 5
©DF. Powered by Blogger.