Skip to content

Instantly share code, notes, and snippets.

@codecademydev codecademydev/app.js Secret
Created Nov 8, 2018

What would you like to do?
Codecademy export
// 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
You can’t perform that action at this time.