So I am creating a simple object with one of the properties being a function... I cannot figure out why when I call it, it outputs undefined!
Here is the code...
const team = {
partner1: "Matthew",
partner2: "Boab",
sayTeamNames: (teamObj) => {
console.log(`${this.partner1} and ${this.partner2}`)
}
}
team.sayTeamNames();
The output I get is...
'undefined and undefined'
I am fairly sure my syntax is correct. Any help would be much appreciated!