π Reference
π Chapter
β£
β£
β£
β£
Map
- Map
- keyμ valueλ₯Ό κ°μ΄ μ μ₯νλ κ°μ²΄μ΄λ€.
- Methods & Properties & for - of문
- for ~ of λ¬Έ
- get()
- has()
- set()
- size
entries()
- 곡μ λ¬Έμ 1
- Map μΈμ€ν΄μ€μ entry() λ©μλλ μ΄ λ§΅μ κ° μμμ λν [ν€, κ°] μμ μ½μ
μμλλ‘ ν¬ν¨νλ μ 맡 λ°λ³΅μ κ°μ²΄λ₯Ό λ°ννλ€.
const map1 = new Map();
map1.set("0", "foo");
map1.set(1, "bar");
const iterator1 = map1.entries();
console.log(iterator1.next().value);
// Expected output: Array ["0", "foo"]
console.log(iterator1.next().value);
// Expected output: Array [1, "bar"]
forEach()
- 곡μ λ¬Έμ 1
- Map μΈμ€ν΄μ€μ forEach() λ©μλλ μ½μ
μμλλ‘ μ΄ λ§΅μ κ° ν€/κ° μλ§λ€ μ 곡λ ν¨μλ₯Ό ν λ²μ© μ€ννλ€.