본문 바로가기
IT/TypeScript

TypeScript 자료형

by 골든크랩 2022. 9. 29.
728x90
반응형

 

■ ECMAScript 표준에 따른 기본 자료형은 6가지

  - Boolean

  - Number

  - String

  - Null

  - Undefined

  - Symbol(ES 6에서 추가됨)

  - Array : object 형

■ 추가된 자료형

  - Any

  - Void

  - Never

  - Unknown

  - Enum

  - Tuple : object 형

 

 

Primitive Type 

- 값 자체이지만, JS의 특징으로 인해, 내장함수를 사용가능

- new 타입(값)  형태를 이용해서 래퍼 객체로 만들수 있음

예) 아래는 모두 object 타입이다.

new Boolean(false);

new String('world');

new Number(42);

 

 

 

=========================================

문법 궁금점 - 아래 3가지의 차이점은???

 

const {remberMe, setRememberMe, setUserAuth, userAuth} = useUser();

const { t: ct } = useTranslation(["common"]);

const [name, setName] = useState("");

 

 

 

궁금한거....다국어 버전 개발시...const { t: ct } 의 의미가는 뭘까?

그냥 변수선언인가? 왜 {} 로 감쌌을까???

 

const { t: ct } = useTranslation(["common"]);

return <div> { ct("IntroPage") } </div>; 

 

https://ddeck.tistory.com/40

 

[React] react 에서 다국어 처리 적용하기(1) - 떽떽대는 개발공부

react 에서 같은 페이지에서 다국어를 적용하기 위해 사용하는 라이브러리가 있다. react-i18next 를 사용하여 다국어 처리를 해보자. 먼저 i18next 와 react-i18next 를 설치한다. // install npm install i18nex..

ddeck.tistory.com

 

 

 

728x90
반응형

댓글