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

underscore.js does this with a pick function

_.pick( {a:1,b:2}, "a" );

underscore is cool.



If you think underscore is cool, you'll go bananas over lodash.


Yet another single letter namespaced project to collide with other single letter namespace projects.


lodash is a replacement for underscore, so it's definitely not as bad as all those '$' libraries. Just make sure lodash gets loaded after underscore, since it's a superset (and faster)


thanks for the suggestion i shall look it up!




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

Search: