Underscore.js
Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It’s the answer to the question: “If I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?” … and the tie to go along with jQuery's tux and
underscore.js 는 내장객체를 확장하지 않고, 사용하기 쉬운 함수 프로그래밍에 도움을 주는 자바스크립트 라이브러리 입니다.
https://github.com/jashkenas/underscore
Downloads
Development Version (1.9.1) |
60kb, Uncompressed with Plentiful Comments
6.5kb, Minified and Gzipped (Source Map)
Installation
- Node.js npm install underscore
- Meteor.js meteor add underscore
- Require.js require(["underscore"], ...
- Bower bower install underscore
- Component component install jashkenas/underscore
유용한 함수들
uniq
_.uniq(array, [isSorted], [iteratee])
Alias: unique findIndex
_.findIndex(array, predicate, [context])
indexOf
_.indexOf(array, value, [isSorted])
contains_.contains(list, value, [fromIndex])
Aliases: include, includes
isEmpty_.isEmpty(object)
반응형
댓글