ts adv
This commit is contained in:
10
ts_playground/08-record.ts
Executable file
10
ts_playground/08-record.ts
Executable file
@@ -0,0 +1,10 @@
|
||||
type statusCode = "OK" | "ERROR" | "NOT_FOUND";
|
||||
|
||||
// 매핑
|
||||
const statMessage: Record<statusCode, string> = {
|
||||
OK: "정상 처리",
|
||||
ERROR: "에러 발생",
|
||||
NOT_FOUND: "찾을 수 없음"
|
||||
};
|
||||
|
||||
console.log(statMessage.NOT_FOUND);
|
Reference in New Issue
Block a user