Skip to content

Commit 203575e

Browse files
committed
배열, 튜플
1 parent 39b192f commit 203575e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@ console.log('[함수 선언]')
1919
function hello(): void {
2020
console.log('hello')
2121
}
22+
23+
hello()
2224
```
2325
:(콜론) 뒤에 함수 반환값의 타입을 명시해줌 <br>
2426

27+
## 배열, 튜플
28+
```ts
29+
// 배열, 튜플 선언
30+
console.log('\n[배열, 튜플 선언]')
31+
32+
// 배열
33+
const p: number[] = [1, 1, 2, 3, 2, 1]
34+
const todayClass: Array<string> = ['Korean', 'Math', "English"] // 제네릭(일반화)
35+
// 튜플
36+
const exam: [string, number] = ['Korean', 100]
37+
```
38+
2539
## 인터페이스
2640
```ts
2741
// 인터페이스

src/index.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,24 @@ let name: string = 'hello'
55
console.log(name)
66

77
// 함수 선언
8-
console.log('[함수 선언]')
8+
console.log('\n[함수 선언]')
99

1010
function hello(): void {
1111
console.log('hello')
1212
}
1313

14+
hello()
15+
16+
// 배열, 튜플 선언
17+
console.log('\n[배열, 튜플 선언]')
18+
19+
// 배열
20+
const p: number[] = [1, 1, 2, 3, 2, 1]
21+
const todayClass: Array<string> = ['Korean', 'Math', "English"] // 제네릭(일반화)
22+
// 튜플
23+
const exam: [string, number] = ['Korean', 100]
24+
25+
1426
// 인터페이스
1527
console.log('\n[인터페이스]')
1628

0 commit comments

Comments
 (0)