Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand this statement. Initially when I saw underscore.js a few weeks ago, I was under the impression it was a light weight js library for when you didn't want to use jquery or something even heavier. Do you use this in conjunction with jquery? Could someone please explain the use case for this library as their is a fair bit of duplication between this and jquery.


Underscore is intended to fit in nicely alongside jQuery -- in the handful of places where the two overlap (map, each, bind), Underscore delegates to the native browser implementations, providing quite a substantial performance boost over the jQuery versions. There is a benchmark script at the bottom of this page, and you can run it in your browser to see the difference:

http://documentcloud.github.com/underscore/test/test.html

In general, Underscore is intended for logic and data manipulation, and jQuery handles the DOM and Ajax calls.


Thank you for clarifying, I appreciate it. There are some very nice data manipulation functions in underscore, and its speed is impressive. I will definitely look into it more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: