I got a completly different code for Dog Years...? help?

Today I did the dog years challenge and go a completely different code or theoretically it’s not the right way of doing it and it’ll cause my issues in the future.

This gets the right answer but it’s so pretty different from what the what through does.

const myName = ‘Dexter’.toLowerCase()

const myAge = 24

let laterYears = (myAge - 2)*4

let earlyYears = 2 * 10.5

let myAgeInDogYears = earlyYears + laterYears

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

This is the code the walk-through did:

const myAge = 24;

let earlyYears = 2;

earlyYears *= 10.5;

let laterYears = myAge - 2;

laterYears *= 4;

let myAgeInDogYears = earlyYears + laterYears

let myName = “Dexter” .toLowerCase();

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

This is the challenge: https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-part-i/modules/fecp-learn-javascript-syntax-introduction/projects/dog-years-javascript

Would appreciate some feedback :slight_smile:

your code is fine, … better than the stuff the exercise wants you to do in some ways, (but it may not pass the requirements for each of the individual steps in the lesson).
Just note that you’ll have to do what the instructions tell you to (in a very specific way) in order to pass the stuff in the Codecademy lessons.

Thank you for the feedback! I’ll make sure too keep that in mind while working through the course.