Borrow a Method Using Bind
let's consider, we have two calculate the age of two different people
const obj1={
firstName:"john"
lastName:"Doe"
yearOfBirth:1999
calcAge=function(){
console.log(`${this.firstName}${this.lastName} age is `${2022-this.yearOfBirth}`)
}
}
in the obo...
balaji567.hashnode.dev2 min read