Skip to content

Instantly share code, notes, and snippets.

@magi196502
Forked from codecademydev/app.js
Created November 8, 2018 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magi196502/3c0339c4e6e1cfa4c4833d5dd7c3a9f1 to your computer and use it in GitHub Desktop.
Save magi196502/3c0339c4e6e1cfa4c4833d5dd7c3a9f1 to your computer and use it in GitHub Desktop.
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