Skip to content

basic-types.md 수정 #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pages/basic-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let octal: number = 0o744;
# 문자열 (String)

웹 페이지, 서버 같은 프로그램을 JavaScript로 만들 때 기본적으로 텍스트 데이터를 다루는 작업이 필요합니다.
다른 언어들처럼, TypeScript에서는 텍스트 테이터 타입을 `string`으로 표현합니다.
다른 언어들처럼, TypeScript에서는 텍스트 데이터 타입을 `string`으로 표현합니다.
JavaScript처럼 TypeScript도 큰따옴표 (`"`)나 작은따옴표 (`'`)를 문자열 데이터를 감싸는데 사용합니다.

```ts
Expand All @@ -53,7 +53,7 @@ color = 'red';
```

또한 *템플릿 문자열* 을 사용하면 여러 줄에 걸쳐 문자열을 작성할 수 있으며, 표현식을 포함시킬 수도 있습니다.
이 문자열은 백틱/백쿼트 (`` ` `` ) 문자로 감싸지며, `${ expr }`과 같은 형태로 표현식을 포함시킬 수 있습니다.
이 문자열은 백틱/백쿼트 (`` ` ``) 문자로 감싸지며, `${ expr }`과 같은 형태로 표현식을 포함시킬 수 있습니다.

```ts
let fullName: string = `Bob Bobbington`;
Expand All @@ -79,7 +79,7 @@ TypeScript는 JavaScript처럼 값들을 배열로 다룰 수 있게 해줍니
let list: number[] = [1, 2, 3];
```

두 번째 방법은 제네릭 베열 타입을 쓰는 것입니다. `Array<elemType>`:
두 번째 방법은 제네릭 배열 타입을 쓰는 것입니다. `Array<elemType>`:

```ts
let list: Array<number> = [1, 2, 3];
Expand Down Expand Up @@ -152,7 +152,7 @@ console.log(colorName); // 값이 2인 'Green'이 출력됩니다.
# Any

애플리케이션을 만들 때, 알지 못하는 타입을 표현해야 할 수도 있습니다.
이 값들은 동적인 콘텐츠에서 올 수도 있습니다. 예) 사용자로부터 받은 데이터. 혹은 3rd party library.
이 값들은 사용자로부터 받은 데이터나 서드 파티 라이브러리 같은 동적인 컨텐츠에서 올 수도 있습니다.
이 경우 타입 검사를 하지 않고, 그 값들이 컴파일 시간에 검사를 통과하길 원합니다.
이를 위해, `any` 타입을 사용할 수 있습니다:

Expand Down