let object = {
name : "Aditya",
age : 20,
printIt : function(){
console.log(this.name + " " + this.age)
}
}
in above object i want to change printIt function in to an arrow function i tried as below but it is not working.
let object = {
name : "Aditya",
age : 20,
printIt = () => {
console.log(this.name + " " + this.age)
}
}
how can we change the printIt function to arrow function in side this object