String Expressions
Strings
π¨βπΌ Strings are one of the most common types of data in programming. Let's
explore what you can do with them.
You can combine strings together using the
+ operator. This is called
concatenation:console.log('Hello' + ' ' + 'World') // Prints: Hello World
π¨ Open
and complete the following tasks:
- Log the result of concatenating
"Hello"and"TypeScript"with a space between them - Log your first name and last name concatenated together
- Log a longer message by concatenating multiple strings
π° Remember to include spaces where you need them - the
+ operator joins
strings exactly as they are!If you're using an AI editor, the editor might try to avoid the extra
+
because you can write this more easily without it. The tests for this step
check for + concatenation, so avoid template literals here.