일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- react
- CSS
- 제로베이스
- 타입스크립트
- 프론트엔드
- 자바스크립트 알고리즘
- Baekjoon
- leetcode
- Next.js13
- JavaScript
- 자바스크립트 문제 풀이
- 자바스크립트 알고리즘 문제
- 자바스크립트코딩테스트
- 알고리즘문제풀이
- til
- leetcode문제풀이
- 자바스크립트
- NPM
- 프로그래머스
- lodash
- JS
- 리액트
- Next
- 자바스크립트 연결리스트
- stack문제
- 자바스크립트 문제
- HTML
- next13
- 자바스크립트 문제풀이
- 리액트쿼리
- Today
- Total
목록find (2)
코드노트
import _ from 'lodash'; const users = [ { userId: '1', name: 'a'}, { userId: '2', name: 'b'}, { userId: '3', name: 'c'}, { userId: '4', name: 'd'}, { userId: '5', name: 'e'} ]; const foundUser = _.find(users, {name: 'a'}); // {userId: "1", name: "a"} _.find 메소드 첫번째 인수는 배열데이터, 두번째 인수는 찾고자 하는 객체로 호출할 수 있다. const foundUserIndex = _.findIndex(users, {name: 'a'}); // 0 _.findIndex 첫번째 인수는 배열데이터, 두번째 ..
length() const number = [1, 2, 3, 4]; const fruits = ['apple', 'banana', 'cherry']; console.log(number.length); // 4 console.log(fruits.length); // 3 console.log([1, 2, 3, 4, 5, 6].length); // 6 console.log([].length); // 0 array 배열데이터에서 length로 개수를 확인할 수 있다. 빈 배열에서는 0을 확인할 수 있다. concat() const numbers = [1, 2, 3, 4]; const fruits = ['apple', 'banana', 'cherry']; const codenote = numbers.concat(..