The example is taken from TypeScript's quick start tutorial
In JavaScript
const greeter = (person) => "hello "+person;
greeter([1,2,3]) // "hello 1,2,3"
In TypeScript
const greeter = (person) => "hello "+person; // error: Parameter 'person' implicitly has an 'any' type.
TSError: ⨯ Unable to compile TypeScript: index.ts:1:18 - error TS7006: Parameter 'person' implicitly has an 'any' type.
Unable to compile - TypeScript provides static typing.
const greeter = (person: string) => "hello " + person;
greeter([1,2,3]) // X3 error: Type 'number' is not assignable to type 'string'
The error is printed out three times because there are three numbers in the array.
const greeter = (person: string) => "hello " + person;
greeter([1,2,3]) // error: Type 'number' is not assignable to type 'string'
const greeter = (person: string) => "hello " + person;
greeter(["1","2","3"]) // error: Argument of type 'string[]' is not assignable to parameter of type 'string'.