Files

1.4 KiB

id, title, challengeType, dashedName
id title challengeType dashedName
660f229d2dbe09ef2954a4a1 Step 42 1 step-42

--description--

Remember in your previous loop that you used the addition operator + to increase the value of i by 1.

You can do a similar thing with a string value, by appending a new string to an existing string. For example, hello = hello + " World"; would add the string " World" to the existing string stored in the hello variable. This is called concatenation.

In your for...of loop, use the addition operator to concatenate the row value to the result value.

--hints--

You should use the concatenation operator on your result variable.

assert.match(__helpers.removeJSComments(code), /(?:result\s*\+|\+\s*result)/);

You should concatenate row to your result variable.

assert.match(__helpers.removeJSComments(code), /result\s*\+\s*row|row\s*\+\s*result/);

You should assign the result of your concatenation back to the result variable.

assert.match(__helpers.removeJSComments(code), /result\s*=\s*(result\s*\+\s*row|row\s*\+\s*result);?/);

--seed--

--seed-contents--

const character = "#";
const count = 8;
const rows = [];

for (let i = 0; i < count; i = i + 1) {
  rows.push(i);
}

let result = ""

--fcc-editable-region--
for (const row of rows) {

}
--fcc-editable-region--

console.log(result);