타입스크립트에서는 "배열"을 for-of문을 통해 간단히 반복할 수 있다.
const numbers:number[] = [1,3,2,6]
for(const num of numbers) {
console.log(num);
}
'typescript' 카테고리의 다른 글
| #타입 추론 #타입 단언 #타입 가드 (1) | 2025.08.14 |
|---|---|
| 제네릭 (1) | 2025.08.14 |
| enum (1) | 2025.08.14 |
| type vs. interface (0) | 2025.08.14 |
| 타입스크립트 "인터페이스" (1) | 2025.08.12 |