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
index.ts
and complete the following tasks:
  1. Concatenate the strings "Hello", a space, and "TypeScript", then log the result (output must include Hello TypeScript)
  2. Concatenate your first name, a space, and your last name, then log the result
  3. Concatenate multiple small string pieces to produce exactly: I am learning to code (include the spaces between words)

Completion criteria

  • Output includes Hello TypeScript
  • Output includes I am learning to code
  • Your source uses the + operator to concatenate string literals at least three times (this step is about concatenation, not template literals)
πŸ’° 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.

Please set the playground first

Loading "String Expressions"
Loading "String Expressions"