
interface Person {
name: string;
age: number;
// func(): void;
func: () => void;
}
const person: Person = {
name: "kjy",
age: 27,
func: function () {
console.log("func");
},
};
func(): void;로도 사용이 가능하다.func(): void;
func(a: number, b: number): void;
/**
* 인터페이스
*/
interface Person {
name: string;
age: number;
// func(): void;
func: () => void;
}
const person: Person = {
name: "kjy",
age: 27,
func: function () {
console.log("func");
},
};
type Func2 = () => void;
const func2: Func2 = () => {
console.log(func2);
};
type Type1 = string | number;
type Type2 = string & number;
한 입 크기로 잘라먹는 타입스크립트
https://www.inflearn.com/course/한입-크기-타입스크립트/dashboard