freeCodeCamp Challenge Guide: Appending Variables to Strings

Appending Variables to Strings


Hints

Hint 1

Make sure your spelling and spacing are correct. Appending strings (stored inside variables) can be done like so:

var adj = "happy!";
var sent = "Today, I woke up being ";
sent += adj; // The result is "Today, I woke up being happy!"
1 Like

var someAdjective = “difficult but rewarding!”;
var myStr = "Learning to code is ";
myStr += someAdjective;

5 Likes