<<<<<<< HEAD Code Wars - Brett Crafton

Twice as old

Question

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

Solution by -

My Solution


	function twiceAsOld(dadYearsOld, sonYearsOld) {
		return Math.abs(dadYearsOld - 2 * sonYearsOld)
		}
				

Try it yourself - CodeWars

======= Code Wars - Brett Crafton

Twice as old

Question

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

Solution by -

My Solution


	function twiceAsOld(dadYearsOld, sonYearsOld) {
		return Math.abs(dadYearsOld - 2 * sonYearsOld)
		}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39