JavaScript JavaScript Basics Working with Strings Combine Strings and Template Literals Review

Consider the following code: let greeting = 'Hi'; greeting = greeting + ', Treehouse students!';

https://teamtreehouse.com/library/javascript-basics/working-with-strings/combine-strings-and-template-literals-review

Consider the following code:

let greeting = 'Hi'; greeting = greeting + ', Treehouse students!'; Complete this code by adding the operator that produces the same result as the above code:

let greeting = 'Hi'; greeting___', Treehouse students!';

I can't figure out what to put in the space after the greeting on the last line. Help!

1 Answer

Ryan Groom
Ryan Groom
18,602 Points

treehouser9 the operator you're looking for is "+=" because it will take what is on the right-hand side of the statement and add it to the left-hand side of the statement and store the result within the variable on the left-hand side of the statement.

Feel free to reach out to me if you have any questions.