Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Concatenating Strings | Section
JavaScript Essentials for Beginners - 1768407374405

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.

Expected output is:

Hello, Alice! Welcome to our website.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 28
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

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.

Expected output is:

Hello, Alice! Welcome to our website.

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 1. Chapter 28
single

single

some-alt