As demonstrated in the previous examples, TypeScript functions extend the usual syntax of JavaScript functions by adding type declarations to the function arguments and to the function return value, as in the following example:
function fullName(x: string, y: string, spaces: number): string {
return x + Array(spaces+1).join(' ') + y;
}
The possibility we have in JavaScript to pass different argument lists is not undermined by strong typing, since TypeScript introduces a limited kind of function overloading. Actually, all TypeScript function overloads compile into a unique JavaScript function, since JavaScript doesn't allow function overloading. Function overloads can't be defined at all in JavaScript, since each function has an indefinite number of optional parameters, so there would be no way to distinguish between functions with the same name...