Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions level-00/0.1-자료형-타입판별/solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export type TypeName =
| "undefined";

export function solution(value: unknown): TypeName {
// TODO: 구현하세요
throw new Error("아직 구현되지 않았습니다");
if (value === null) return "null";
else if (Array.isArray(value)) return "array";

return typeof value as TypeName;
}
Loading