| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- typescript
- Certbot
- docker
- Generics
- ChatGPT
- javascript
- Functional Programming
- stream
- 자료구조
- Schema Registry
- GPT
- vscode
- https
- 비주얼 스튜디오 코드
- nestjs
- Linux
- MSK
- AI
- 함수형프로그래밍
- node.js
- html
- python
- GIT
- Express
- MSA
- Let's Encrypt
- 파이썬
- nodeJS
- ES6
- 알고리즘
- Today
- Total
목록map (2)
JangBaGeum.gif
Map() Map()은 Javascript ES6의 key-value 쌍의 컬렉션이다. key는 중복될 수 없다. key를 이용해 값을 찾거나(get), 설정(set)할 수 있다. key로 사용할 수 있는 데이터 형은 string, symbol, object, function이며 number는 사용할 수 없다. 엔트리 조회와 추가 - map.get(), map.set() const menu = new Map() menu.set('001', {code: "001", name: "콜라"}) menu.set('002', {code: "002", name: "환타"}) console.log(menu.get('001'))// {code: '001', name: '콜라'} // const lastName = new..
Set()Array.from과 spread syntax인 ...을 사용 가능하다.const x = new Set([ 1, 2, 3, 4 ]);const y = Array.from(x);console.log(y); // = [ 1, 2, 3, 4 ]const z = [ ...x ];console.log(z); // = [ 1, 2, 3, 4 ] Met()map도 Array.from과 spread syntax(...)의 사용이 가능하다.const map = new Map([[ 1, 'one' ],[ 2, 'two' ]]);const newArr1 = [ ...map ]; const newArr2 = Array.from( map );console.log(newArr1); // [[ 1, 'one' ],..