HEAD
Your function takes two arguments: 1. current father's age (years) 2. current age of his son (years) Сalculate how many years ago the father was twice as old as his son (or in how many years he will be twice as old).
No examples
function twiceAsOld(dadYearsOld, sonYearsOld) {
return Math.abs(dadYearsOld - 2 * sonYearsOld)
}
Try it yourself - CodeWars
Your function takes two arguments: 1. current father's age (years) 2. current age of his son (years) Сalculate how many years ago the father was twice as old as his son (or in how many years he will be twice as old).
No examples
function twiceAsOld(dadYearsOld, sonYearsOld) {
return Math.abs(dadYearsOld - 2 * sonYearsOld)
}
Try it yourself - CodeWars