Recent Posts
Recent Comments
Link
Today
Total
05-08 22:23
관리 메뉴

채린씨의 티스토리

[TypeChallenges] 13. Hello World (warm-up) 본문

FE/TypeScript

[TypeChallenges] 13. Hello World (warm-up)

채린씨 2023. 3. 24. 19:28

문제

Hello, World!

In Type Challenges, we use the type system itself to do the assertion.

For this challenge, you will need to change the following code to make the tests pass (no type check errors).

// expected to be string
type HelloWorld = any
// you should make this work
type test = Expect<Equal<HelloWorld, string>>

(출처: https://github.com/type-challenges/type-challenges/blob/main/questions/00013-warm-hello-world/README.md)

 

 


나의 풀이

type HelloWorld = string

 


참고자료

https://joshua1988.github.io/ts/guide/basic-types.html#string

 

기본 타입 | 타입스크립트 핸드북

타입스크립트 기본 타입 타입스크립트로 변수나 함수와 같은 자바스크립트 코드에 타입을 정의할 수 있습니다. 타입스크립트의 기본 타입에는 크게 다음 12가지가 있습니다. Boolean Number String Obj

joshua1988.github.io

 

'FE > TypeScript' 카테고리의 다른 글

[TypeChallenges] 7. Readonly (easy)  (0) 2023.03.24
[TypeChallenges] 4. Pick (easy)  (0) 2023.03.24
Comments