function calculateRetirement(year){
const age = new Date().getFullYear()-year;
return[age, 65-age];
}
const[age,retirement]=calculateRetirement(1989);
console.log(`age${age} retirement${retirement}`);
When single task can be done by multiple groups/family of objects and decision is taken at the runtime.
No comments:
Post a Comment