일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- mySQL_Replication
- pm2 상태 확인
- c# datagridview 데이터 넣기
- setInterval 외부 정지
- pm2
- Replication
- 데이터테이블 데이터 넣기
- setInterval 중지
- allow_anonymouse
- setInterval clear
- DatePicker
- 공인IP
- 맥 어드레스
- pm2 설치
- mosquitto.conf
- AntDesign
- map이 undefined가 뜰 때
- timepicker
- invalid data
- datagridview 직접입력
- listener 1883
- pm2 확인
- DataGridView 직접 입력
- html #select #option #multiple
- 1883
- pm2 시작
- transfer
- mosquitto
- setInterval 정지
- 서버동기화
- Today
- Total
목록분류 전체보기 (741)
개발 노트
- 배열의 각 요소에 대해 주어진 함수를 사용하여 하나의 결과값을 계산 - 요소를 순회하며 누적 값을 계산하는데 유용 - 배열 내 요소들을 하나의 값으로 축약하는 작업에 활용 const numbers = [1, 2, 3, 4, 5]; const sum = numbers.reduce((accumulator, currentValue) => accumulator + currentValue, 0); console.log(sum); // 출력: 15
- 배열의 요소를 주어진 함수에 따라 정렬 - 원본 배열을 변형 - 정렬된 배열을 반환 const numbers = [4, 2, 8, 5, 1]; numbers.sort((a, b) => a - b); console.log(numbers); // [1, 2, 4, 5, 8]
- 배열의 각 요소에 대해 주어진 함수를 실행하는 데 사용 - 배열을 순회하며 각 요소에 대해 작업을 수행 - 새로운 배열을 반환 x - 기존 배열의 요소를 변형 x const fruits = ['apple', 'banana', 'orange']; fruits.forEach((fruit, index) => { console.log(`Fruit at index ${index}: ${fruit}`); }); // 출력값 // Fruit at index 0: apple // Fruit at index 1: banana // Fruit at index 2: orange 만약 배열의 요소를 변형하거나 새로운 배열을 생성하려면 map() 메서드를 사용하는 것이 더 적합
- 배열에서 특정 요소의 인덱스를 검색 - 만약 배열 내에 해당 요소가 존재하지 않으면 -1을 반환 const fruits = ['apple', 'banana', 'orange', 'apple', 'grape']; const appleIndex = fruits.indexOf('apple'); console.log(appleIndex); // 출력: 0 const orangeIndex = fruits.indexOf('orange'); console.log(orangeIndex); // 출력: 2 const nonExistentIndex = fruits.indexOf('pear'); console.log(nonExistentIndex); // 출력: -1
- 배열에서 주어진 조건을 만족하는 첫 번째 요소를 찾아 반환 - 해당 요소를 찾으면 더 이상 검색을 진행하지 않고 검색을 종료 - 만족하는 조건이 없다면 undefined를 반환 const students = [ { id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }, { id: 3, name: 'Charlie' }, ]; const student = students.find(student => student.id === 2); console.log(student); // 출력: { id: 2, name: 'Bob' }