0
0
Javascriptprogramming~15 mins

String concatenation in output in Javascript - Mini Project: Build & Apply

Choose your learning style9 modes available
String concatenation in output
📖 Scenario: You are creating a simple program that greets users by combining their first and last names into a full greeting message.
🎯 Goal: Build a program that concatenates strings to create a personalized greeting message and displays it.
📋 What You'll Learn
Create variables to store first and last names
Create a variable to store a greeting prefix
Concatenate the greeting prefix with the full name
Print the final greeting message
💡 Why This Matters
🌍 Real World
Combining strings is useful for creating messages, labels, and user interface text dynamically.
💼 Career
String concatenation is a basic skill needed for web development, scripting, and many programming tasks.
Progress0 / 4 steps
1
Create variables for first and last names
Create two variables called firstName and lastName and assign them the exact string values "John" and "Doe" respectively.
Javascript
Need a hint?

Use const to create variables and assign string values with double quotes.

2
Create a greeting prefix variable
Create a variable called greeting and assign it the exact string value "Hello".
Javascript
Need a hint?

Use const greeting = "Hello"; to create the greeting prefix.

3
Concatenate greeting with full name
Create a variable called fullGreeting that concatenates greeting, a space, firstName, a space, and lastName using the + operator.
Javascript
Need a hint?

Use the + operator to join strings with spaces in between.

4
Print the full greeting message
Use console.log to print the variable fullGreeting.
Javascript
Need a hint?

Use console.log(fullGreeting); to display the message.