I have another small, annoying, and laughable problem. Below is the link to the place of my annoyance:
(@hampusscandgate, I trust that there is not a typo in the link )
I am concerned with the second problem –
Use console.log to print: ‘My favorite animal: Koala’, but replace ‘Koala’ with your favoriteAnimal variable.
(My favorite animal is the robin, but that doesn’t matter.) Now, how do I replace a word? do I type in
>let favoriteAnimal = 'robin';
**console.log('My favorite animal is a Koala' - 'Koala'+ favoriteAnimal)
Please help, anyone! I eagerly await your replies!
To modify strings when they’re being logged to the console, you wouldn’t subtract the specific word.
The example the exercise gives is
var myPet = “armadillo”
console.log('I own a pet ’ + myPet + ‘.’);
To solve it, you’d do something like
console.log("My favorite animal: " + favoriteAnimal + '.');
Oooh. So I wasn’t supposed to type in Koala! Thanks for the help!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.