As a beginner in self-learning, I've recently started diving into the world of JavaScript. Currently, I am facing a challenge with an assignment from an online code camp that I just can't seem to figure out. Despite grasping the basics, I struggle to execute it effectively. Can anyone offer assistance?
The specific question is provided in the attached image.
Here is a snippet of my existing code:
function ageCalculator(name, yearOfBirth, currentYear) {
var age = currentYear - yearOfBirth;
return (name + "is" + age + "years old.");
console.log(ageCalculator("Miranda", 1983, 2015));
}
Your help would be greatly appreciated. Thank you!