...

Exercise: Adventure Gear

You're preparing for an exciting adventure trip, and you need to create a checklist of items to pack.

In this exercise, you will write a program that:

  • Asks the user for the name of the first item using the prompt function.
  • Asks the user for the name of the second item using the prompt function.
  • Concatenates the two item names into a single checklist string.
  • Prints the checklist to the console in the format: "Your adventure gear checklist: ITEM1, ITEM2".

String Concatenation

Remember: when you use the + operator with strings, JavaScript combines them into a single string. For example:

let part1 = "Hello";
let part2 = "World";
let message = part1 + " " + part2;
console.log(message); // Outputs: "Hello World"

Now it's your turn! Complete the code sample in the editor to display a well-formatted checklist in the format: "Your adventure gear checklist: ITEM1, ITEM2".

Loading...

Output (Console)