Why is my function argument giving a type error in typescript?

Example:

function greet(name: string) {
    console.log('Hello, ' + name);
}
greet(123);  // Error: Argument of type 'number' is not assignable to parameter of type 'string'.
Solution:

function greet(name: string) {
    console.log('Hello, ' + name);
}
greet('123');  // Corrected argument to be a string
Ensure that function arguments match the expected parameter types as specified in the function declaration.

Beginner's Guide to TypeScript