Convert human age to dog age

The following code is from Codecademy Java Script lesson practice. It doesn’t run on the comfiler. I don’t know what is wrong with the code. Could anyone help me? Thank you!

const myAge = 42;

let earlyYears = 2;
earlyYears * = 10.5;

let laterYears = myAge-2;
laterYears *=4;


let myAgeInDogYears = earlyYears+laterYears;
let myName = “Eunhae”.toLowerCase();

console.log(‘My name is {myName}. I am {MyAgeInDogYears} years old in dog years.’);

The operator cannot have any white space. *= vs. * =.

1 Like

Thank you so much for your help. Even though I corrected the operator space, the code still does not print my name nor my age in dog year on the console window. An online compiler only says there is a problem with console.log parts.

The problem is with the template literal. It must be enclosed in back-ticks, not regular quotes and the expressions need a $ prefix.

 `a string ${interpolated expression} literal`
1 Like

Thank you very much for your reply. Now I understand and I am happy! I appreciate your kindness and help.

1 Like