Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Concatenating Strings | Manipulating Data
Introduction to JavaScript

bookChallenge: Concatenating Strings

Task

Swipe to start coding

You're building a welcome message system for a website that greets users by their name. To do this, you'll combine multiple strings into one complete message.

  1. Declare and initialize a variable named username with the value "Alice".
  2. Declare and initialize another variable named welcomeMessage that combines the following parts in this exact order:
    • "Hello, "
    • the variable username
    • "! Welcome to our website."
  3. Print (console.log) the contents of welcomeMessage.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 14
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain that in simpler terms?

What are the main benefits of this approach?

Are there any common mistakes to avoid with this?

close

Awesome!

Completion rate improved to 1.33

bookChallenge: Concatenating Strings

Swipe to show menu

Task

Swipe to start coding

You're building a welcome message system for a website that greets users by their name. To do this, you'll combine multiple strings into one complete message.

  1. Declare and initialize a variable named username with the value "Alice".
  2. Declare and initialize another variable named welcomeMessage that combines the following parts in this exact order:
    • "Hello, "
    • the variable username
    • "! Welcome to our website."
  3. Print (console.log) the contents of welcomeMessage.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 14
single

single

some-alt