I have made an arrow function as below, nested in the getdata function, when I call the getdata function, it outputs undefined, what am I doing wrong?
let person = {
name: "Mario",
age: 30,
salary: 5555,
getdata: function () {
welcome = () => {
return `hello: ${this.name} your age is ${this.salary}`
};
},
}
console.log(person.getdata())
getdata, the only return is inside the arrow function expression set towelcomewhich isn't a return forgetdata