Im stuck

Hey guys it’s my first day coding and am stuck so I hope you can help me out
so this is :the instruction I got : 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.
and this is the code I used and I don’t know why it’s not working :
let favoriteAnimal = ‘DOG’;
console.log(‘My favorite animal’ +’ '+ favoriteAnimal+ ‘.’)
please help mee

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

You should use this:

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

Try this code. The whole string is surrounded with back tick.
let favoriteAnimal = ‘DOG’;
console.log(My favorite animal: ${favoriteAnimal });

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