티스토리 뷰

Underscore.js: JavaScript Utility Library
http://underscorejs.org/

- Java의 Google Guava와 같은 Common Utility 성격의 JavaScript 라이브러리
- 상대적으로 빈약한 JavaScript 표준 함수를 보완하는 역할로 간결한 코드를 가능하게 함

An Introduction to Underscore.js (by Dan Wellman)
http://www.developerdrive.com/2012/04/an-introduction-to-underscore-js-%E2%80%93-part-1-arrays/
http://www.developerdrive.com/2012/05/an-introduction-to-underscore-js-%E2%80%93-part-2-array-like-collections/

Getting Cozy with Underscore.js (by Siddharth)

http://net.tutsplus.com/tutorials/javascript-ajax/getting-cozy-with-underscore-js/


Some Useful Underscore Methods (by Sagar H Ganatra)
http://css.dzone.com/articles/some-useful-underscore-methods


<예제>

아래 예제는 환율 코드의 리스트 객체에서 text = 'USD'인 객체를 찾아내는 역할을 수행한다.

Underscore.js의 _.find() 메써드를 사용했다.

var currencyCodeList = [{
    value: 'KRW',
    text: 'Won'},
{
    value: 'USD',
    text: 'Dollar'}
];


var selectedCurrencyCode = _.find(currencyCodeList, function(object) {
return object.value == 'USD';
});


alert(selectedCurrencyCode.value);


댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함