0
Someone help me solve this??
Write a function called calcAge. This function should take one parameter and it should return you implied age( dont worry about months). Call the function passing the current year as the parameter.
1 Answer
+ 2
Assuming the year you were born is defined outside of the function, but within its scope;
let yearBorn = 1974;
function calcAge(currentYear) {
return currentYear - yearBorn;
}
console.log(calcAge(2018));