Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

1.7 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
56533eb9ac21ba0edf2244b7 Concatenating Strings with Plus Operator 1 16802 concatenating-strings-with-plus-operator

--description--

In JavaScript, when the + operator is used with a String value, it is called the concatenation operator. You can build a new string out of other strings by concatenating them together.

Example

'My name is Alan,' + ' I concatenate.'

Note: Watch out for spaces. Concatenation does not add spaces between concatenated strings, so you'll need to add them yourself.

Example:

const ourStr = "I come first. " + "I come second.";

The string I come first. I come second. would be displayed in the console.

--instructions--

Build myStr from the strings This is the start. and This is the end. using the + operator. Be sure to include a space between the two strings.

--hints--

myStr should have a single space character between the two strings.

assert(/start\. This/.test(myStr));

myStr should have a value of the string This is the start. This is the end.

assert(myStr === 'This is the start. This is the end.');

You should use the + operator to build myStr.

assert(__helpers.removeJSComments(code).match(/(["']).*\1\s*\+\s*(["']).*\2/g));

myStr should be created using the const keyword.

assert(/const\s+myStr/.test(__helpers.removeJSComments(code)));

You should assign the result to the myStr variable.

assert(/myStr\s*=/.test(__helpers.removeJSComments(code)));

--seed--

--seed-contents--

const myStr = ""; // Change this line

--solutions--

const myStr = "This is the start. " + "This is the end.";