← 문제 목록
초급 TypeScript 30P

유니온 타입 좁히기 누락

다음 TypeScript 코드에서 버그를 찾으세요:
TYPESCRIPT
function formatValue(value: string | number): string {
    return value.toFixed(2);
}

console.log(formatValue(3.14));
console.log(formatValue("hello"));

답변

로그인 후 제출하기
0명 풀이 · 정답률 0%