mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-23 21:04:36 -05:00
1.2 KiB
1.2 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 660f487dc0c8fa38084f9754 | Step 92 | 1 | step-92 |
--description--
Since you have moved the comparison into the while condition, you can remove your entire if statement.
--hints--
You should no longer have an if statement.
assert.notMatch(__helpers.removeJSComments(code), /if\s*\(\s*done\)/);
You should no longer set continueLoop to false.
assert.lengthOf(__helpers.removeJSComments(code).match(/continueLoop\s*=\s*false/g), 1);
--seed--
--seed-contents--
const character = "#";
const count = 8;
const rows = [];
function padRow(rowNumber, rowCount) {
return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}
// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
rows.push(padRow(i, count));
}*/
let continueLoop = false;
let done = 0;
--fcc-editable-region--
while (done !== count) {
done++;
rows.push(padRow(done, count));
if (done === count) {
continueLoop = false;
}
}
--fcc-editable-region--
let result = ""
for (const row of rows) {
result = result + "\n" + row;
}
console.log(result);