-
-
Save codecademydev/3974d6821f1d85918ef84a09a46955c1 to your computer and use it in GitHub Desktop.
Codecademy export
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
// Set human age | |
const myAge = 41; | |
// Set early years | |
let earlyYears = 2; | |
// Multiply the early years by 10.5 | |
earlyYears *= 10.5; | |
// Subtract 2 from current age since the age for | |
// the first 2 years has been already calculated. | |
let laterYears = myAge - 2; | |
// The laterYears can now be calculated by multiplying by 4 | |
laterYears *= 4; | |
// Now the total years in dog years can be calculated | |
let myAgeInDogYears = earlyYears + laterYears; | |
// Define name and set to lower case. | |
const myName = 'Macy'.toLowerCase(); | |
console.log(`My name is ${myName}. I am ${myAge} years old in human years which is ${myAgeInDogYears} years old in dog years.`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment