타입스크립트 코드에서 어떤 변수 또는 값의 타입을 표기하기 위해 타입 표기를 사용한다. 타입 표기는 식별자 또는 값 뒤에 콜론(:)을 붙여 value: type 의 형태로 표기한다.
 
const areYouCool: boolean = true;
 
const answer: number = 42;
 
const typescript: string = "great";
 
const greetings: string = `
 
Hello, Readers!
 
Welcome to TypeScript.
 
`;
 
const hasType: Object = {
 
TypeScript: true,
 
JavaScript: false
 
};
 
 
손에 너무 안익는다

+ Recent posts