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:

const adj = "happy!";
let sent = "Today, I woke up being ";
sent += adj; // The result is "Today, I woke up being happy!"
7 Likes

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

12 Likes