In the previous lessons, we’ve put strings into variables. Now, let’s put a variable’s value into a string!
We can use the
+ operator from earlier to interpolate (insert) a variable into a string, like this:
var myPet = 'armadillo'; console.log('I own a pet ' + myPet + '.'); // Output: 'I own a pet armadillo.'
Create a variable named
favoriteAnimal and set it equal to your favorite animal.
console.log to print:
'My favorite animal: Koala', but replace
'Koala' with your