function calculateRetirement(year){
const age = new Date().getFullYear()-year;
return[age, 65-age];
}
const[age,retirement]=calculateRetirement(1989);
console.log(`age${age} retirement${retirement}`);
Summary: -------- 1. Functions should hardly ever be 20 lines long. 2.Keep blocks (inside if, else, while, for, etc.) short. Ideally, j...
No comments:
Post a Comment