Quiz · Unions and literal types · lesson 2 of 8
Quiz — a shared method
On which line does tsc report an error?
function show(id: string | number) {
console.log(id.toString());
console.log(id.length);
}
show(42);On which line does tsc report an error?
function show(id: string | number) {
console.log(id.toString());
console.log(id.length);
}
show(42);