Why does TypeScript not complain in strict mode about the following scenarios?
function test(firstName: string, lastName?: string): string {
return firstName + " " + lastName;
}
test('John');
Or this?
const str: string = '';
const num: object = {};
const result: string = str + num;
I find it strange that TypeScript doesn't raise errors for cases like 'John undefined' or '[object Object]'. Shouldn't type checking be able to catch such issues? (Unlike Flow)