Why even in strict mode TypeScript is not complaining about this
function test(firstName: string, lastName?: string): string {
return firstName + " " + lastName;
}
test('John');
Nor about this
const str: string = '';
const num: object = {};
const result: string = str + num;
I don't remember cases when I would want to get and print on the screen 'John undefined' or '[object Object]'. Is the whole point of type checking is supposed to be catching such errors? (Flow does it)