I am trying to invoke this function
const logPerson = (person: { name: string; age: number }) => {
console.log('name:', person.name, 'age:', person.age);
}
I tried
let person = (_name:'Mike Pompeo', _age:'25')
But
logPerson(person)
returns
[LOG]: "name:", undefined, "age:", undefined
How to fix this?
let person = (_name:'Mike Pompeo', _age:'25')butlogPerson(person)returns[LOG]: "name:", undefined, "age:", undefined." All due respect, I find that hard to believe.let person = (_name:'Mike Pompeo', _age:'25')is a syntax error as of the first:(in JavaScript) or the)(in TypeScript).