Wait for tsc. A type error shows in the output instead of running.
Goal
Log a typed city name.
const city: string = "Nairobi";
console.log(city);function greet(name: string): string {
return "Hello, " + name;
}
console.log(greet("Mombasa"));Wait for tsc, console.log, Run, and privacy.
Wait for tsc. A type error shows in the output instead of running.
Log a typed city name.
const city: string = "Nairobi";
console.log(city);function greet(name: string): string {
return "Hello, " + name;
}
console.log(greet("Mombasa"));