Appending Variables to Strings wont work

Appending Variables to Strings wont work
0

#1

Tell us what’s happening:

Your code so far


// Example
var anAdjective = "awesome!";
var ourStr = "freeCodeCamp is ";
ourStr += anAdjective;

// Only change code below this line

var someAdjective = "wonderful";
var myStr = "Learning to code is ";
myStr += "someAdjective";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/appending-variables-to-strings/


#2

So you’re appending the WORD “someAdjective” to your string, not the VARIABLE someAdjective. Do you see a difference in the way you add that variable from the way the sample shows? Hint: look at the quote marks.


#3

When you have troubles, you could try debugging using console.log(). For example in your case try adding this line at the end of your code to see why the code is not passing (it will be covered better in future challenges, but it is really useful)

console.log(myStr);