Underscore.JS-유틸리티
Underscore.JS에는 사용하기 쉬운 유틸리티 메서드가 많이 있습니다. 이 장에서는 이에 대해 자세히 설명합니다.
Underscore.JS는 아래와 같이 다양한 유틸리티 방법을 제공합니다.
| Sr. 아니. | 방법 및 구문 |
|---|---|
| 1 | 정체 _.identity (값) |
| 2 | 일정한 _.constant (값) |
| 삼 | 누프 _.noop () |
| 4 | 타임스 _.times (n, iteratee, [context]) |
| 5 | 무작위 _.random (최소, 최대) |
| 6 | 믹스 인 _.mixin (객체) |
| 7 | iteratee _.iteratee (값, [컨텍스트]) |
| 8 | uniqueId _.uniqueId ([접두사]) |
| 9 | 탈출 _.escape (문자열) |
| 10 | Unscape _.unescape (문자열) |
| 11 | 결과 _.result (객체, 속성, [defaultValue]) |
| 12 | 지금 _.지금() |
| 13 | 주형 _.template (templateString, [설정]) |