Problem in Exercise 7/10 of Variables

Hi! Im new to programming experience so of course im pretty noob and maybe my consult was already answered. In the JS exorcices i have a problem with the exercise 7/10 of Variables.
Problem is, when i see the results with console.log() it has no Syntax or Structure Error so… I have no idea what’s going on! Im totally stuck in this one. Thx in advance!

EXERCISE

1.
Create a variable named favoriteAnimal and set it equal to your favorite animal.
2.
Use console.log() to print 'My favorite animal: ANIMAL' to the console. Use string concatenation so that ANIMAL is replaced with the value in your favoriteAnimal variable.

ANSWER

let favoriteAnimal = “Capibara”;
console.log ("My favorite animal is " + favoriteAnimal + “.” );
let ANIMAL = favoriteAnimal;
console.log ("My favorite animal: " + ANIMAL + “.”);

RESULT

My favorite animal is Capibara.
My favorite animal: Capibara.

There is no error. Your first attempt follows the instructions, exactly. That’s all you needed to do.

ANIMAL was the author’s way of showing where to insert favoriteAnimal, as in a placeholder.

1 Like

Hi @mtf. First of all thx for the answer! The problem in my case is the exercise doesnt check like right answer as if I had done the exercise wrong. this doesnt allow me to continue with the next exercise unfortunately

Your first example is close to correct, just needs the colon (instead of, ‘is’) like in the placeholder example.

Hey @mtf i tried that one and unfortunately it still does not mark the exercise as correct. I will see a video of YT where they solve this same exercise to see what I screwed up! thx again i see a lot of answers of yours that were really helpfull! im 30 years old and introducing a new world like this is really hard to me hehe

1 Like

You can look at the solution to see how it compares to yours. Cancel out of that and fix your code, then Run.

1 Like

i must be blind! i didnt saw that option! thx for the third time in an hour!
i think the problem was that i misunderstud the exercise since ANIMAL wasnt a value to be replaced but just a generic example to reffer to the first statement’s value

this is the correct answer:

let favoriteAnimal = “giraffe”;

console.log("My favorite animal: " + favoriteAnimal);

1 Like