Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- localStorage
- 파티셔닝
- partitioning
- PostgreSQL
- 열공하자
- 실시간알림
- 개발자
- SSE
- Partition
- 성장기
- Node.js기본
- frontend
- node.js
- node.js란
- ServerSentEvent
- Lag
- EventSource
- mariadb
Archives
- Today
- Total
써치킴의 우당탕탕 개발 블로그
[TypeScript][Ch2][Basic Types] Array 본문
Array
- 원래 JavaScript에서 Array는 객체이다.
- 사용방법
- Array<타입>
- 타입[]
- union type 가능
// typescript는 타입을 지정하지 않아도 타입을 유추해서 지정
let list = [1, 2, 3];
// array 선언방법 1(권장)
let listN: number[] = [1, 2, 3];
// array 선언방법 2
let listN2: Array<number> = [1, 2, 3];
// union 타입도 가능
let listN3: (number | string)[] = [1, 2, 3, '4'];
'TypeScript 합시다' 카테고리의 다른 글
[TypeScript][Ch2][Basic Types] any (0) | 2022.02.10 |
---|---|
[TypeScript][Ch2][Basic Types] Tuple (0) | 2022.02.10 |
[TypeScript][Ch2][Basic Types] object (0) | 2022.02.10 |
[TypeScript][Ch2][Basic Types] null & undefined (0) | 2022.02.09 |
[TypeScript][Ch2][Basic Types] symbol (0) | 2022.02.09 |
Comments