Created
March 27, 2018 13:27
-
-
Save rajasegar/abc507a94c2124ab4c6a3c117790197d to your computer and use it in GitHub Desktop.
Communication cohesion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeToRetire(birthday) { // birthday is a date | |
const RETIREMENT_AGE = 65; | |
let ageDifMs = Date.now() - birthday.getTime(); | |
let ageDate = new Date(ageDifMs); // miliseconds from epoch | |
let age = Math.abs(ageDate.getUTCFullYear() - 1970) | |
let _timeToRetire = RETIREMENT_AGE - age; | |
return _timeToRetire; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment