Project: Dog Years

This project was about calculating your human age in dog years.

// Setting a variable called myAge that can NOT be changed:
const myAge = 25;

// This is a variable that will change so we'll set it with "let"
let earlyYears = 2;

earlyYears *= 10.5;

let laterYears = myAge - 2;

laterYears *= 4;


// To figure out my dog in age years, I create a variable with that name and then multiply "early years" and "later years" together:
myAgeInDogYears = earlyYears * laterYears

// Quick check of my math to see what value my age in dog years is:

// Here's my name as a string and I'm forcing it into lowercase with the '.toLowerCase();'
myName = 'BriYaWn JawhNNsin'.toLowerCase();

console.log(`My name is ${myName}.  I am ${myAge} in human years which is ${myAgeInDogYears} in dog years.`)

Last updated