Not sure what I'm missing with String Interpolation?


var favoriteAnimal = 'dog';
console.log('My favorite Animal: ' + dog);

I have redone this several times. I'm sure the solution is obvious. This is the wording of the problem:
Create a variable named favoriteAnimal and set it equal to your favorite animal.

Then, use console.log to print: 'My favorite animal: Koala', but replace 'Koala' with your favoriteAnimal variable.
Use the + operator to interpolate the favoriteAnimal variable.



it wants you to call the variable. this means that you created the variable favoriteAnimal and made it equal Dog and now instead of just typing dog you can use the name of the variable favoriteAnimal instead. so when you typed console.log('My favorite Animal: ' + dog);
it wants you to use the name of the variable that you made in the line before.


O_M_G, right in front of my face! Thanks so, so much!


haha its no problem. even little mistakes can mess your whole program up, but don't get discouraged because eventually it will all just click into place. good luck on the course! :smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.