Exploring the world of typescript (2.5.2) and looking for clarity on why the first call works but the second one encounters an error:
function printPerson(person: {firstName: string; lastName: string}): void{
console.log(person.firstName + " " + person.lastName);
}
let geo = {firstName: "geo", lastName: "porz", sex: "M"};
printPerson(geo); //This works fine
// TS2345 Argument of type ... is not assignable to parameter of type ...
printPerson({firstName: "geo", lastName: "porz", sex: "M"});