javascript 라이브러리 로다쉬 - 배열,객체, 문자열 관련 유용한 라이브러리
아시는분이 많을거라 생각하고 있습니다.
배열,객체, 문자열 관련 자바스크립트 유용한 라이브러리인 로다쉬를 소개를 하려고합니다.
CDN 설치
로다쉬 CDN 리스트 경로 https://www.jsdelivr.com/package/npm/lodash
해동 경로
로 이동하셔서 카피를 누르면 태그가 복사됩니다.
[code]
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js" integrity="sha256-qXBd/EfAdjOA2FGrGAG+b3YBn2tn5A6bhz+LSgYD96k=" crossorigin="anonymous"></script>
[/code]
패키지 설치
[code]
npm install --save lodash
[/code]
_.findIndex(array, [predicate=_.identity], [fromIndex=0])
=>배열에서 인덱스 리턴에 사용
[code]
var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': true } ]; _.findIndex(users, function(o) { return o.user == 'barney'; }); // => 0 // The `_.matches` iteratee shorthand. _.findIndex(users, { 'user': 'fred', 'active': false }); // => 1 // The `_.matchesProperty` iteratee shorthand. _.findIndex(users, ['active', false]); // => 0 // The `_.property` iteratee shorthand. _.findIndex(users, 'active'); // => 2
[/code]
_.uniq(array)
=>배열의 중복 값을 제거 , 각 요소의 첫 번째 항목만 유지
[code]
_.uniq([2, 1, 2]);
// => [2, 1]
[/code]
자세한 정보 : https://lodash.com/
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5186 | PHP |
swallow
|
2년 전 | 943 | |
| 5185 | PHP |
swallow
|
2년 전 | 962 | |
| 5184 | PHP |
swallow
|
2년 전 | 539 | |
| 5183 | PHP |
swallow
|
2년 전 | 847 | |
| 5182 | PHP |
swallow
|
2년 전 | 778 | |
| 5181 | 기타 |
swallow
|
2년 전 | 1022 | |
| 5180 | 2년 전 | 574 | |||
| 5179 | 기타 |
swallow
|
2년 전 | 1434 | |
| 5178 | PHP |
swallow
|
2년 전 | 796 | |
| 5177 | JavaScript |
swallow
|
2년 전 | 1493 | |
| 5176 | PHP |
swallow
|
2년 전 | 1189 | |
| 5175 | 2년 전 | 566 | |||
| 5174 | 기타 | 2년 전 | 816 | ||
| 5173 | PHP |
|
2년 전 | 969 | |
| 5172 | PHP |
|
2년 전 | 1253 | |
| 5171 | 기타 |
그누GPT
|
2년 전 | 1556 | |
| 5170 | PHP |
|
2년 전 | 1054 | |
| 5169 | PHP |
|
2년 전 | 1227 | |
| 5168 | PHP |
|
2년 전 | 1200 | |
| 5167 | JavaScript |
|
2년 전 | 999 | |
| 5166 | MySQL | 2년 전 | 1192 | ||
| 5165 | MySQL | 2년 전 | 1256 | ||
| 5164 | PHP | 2년 전 | 1502 | ||
| 5163 | OS |
|
2년 전 | 843 | |
| 5162 | 웹서버 |
|
2년 전 | 893 | |
| 5161 | 웹서버 |
|
2년 전 | 975 | |
| 5160 | PHP |
|
2년 전 | 843 | |
| 5159 | PHP |
|
2년 전 | 907 | |
| 5158 | PHP |
|
2년 전 | 918 | |
| 5157 | PHP |
|
2년 전 | 943 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기