01 / 05
The type goes after the parameter
A function parameter takes a type after a :, just like a variable.
Write this and passing in the wrong kind of value becomes an error where you called it. You do not have to go hunting inside the function.
function greet(personName: string) { console.log("Hello, " + personName);}greet("Yui");Result
Hello, Yui