- Map 객체 (JavaScript)
- 키값으로 다양한 자료형을 쓸 수 있는 객체
set()
, get()
, delete()
, keys()
, values()
, entries()
, clear()
등 다양한 메서드 사용하여 간편함
Array.prototype.flatMap()
메서드 (JavaScript)
Array.prototype.flat()
이 뒤따르는 Array.prototype.map()
과 동일하게 작동합니다.
- Generic 과 any 차이, 복수 Generic (TypeScript)
type SuperPrint = {
(arr: any[]): any
}
const superPrint: SuperPrint = (arr) => arr[0]
let a = superPrint([1, "b", true]);
a.toUpperCase();
type SuperPrint = {
(arr: T[]): T
}
const superPrint: SuperPrint = (arr) => arr[0]
let a = superPrint([1, "b", true]);
a.toUpperCase();
type SuperPrint = {
(arr: T[], x: M): T
}
const superPrint: SuperPrint = (arr, x) => arr[0]
let a = superPrint([1, "b", true], "hi");