mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-22 03:26:02 -05:00
1.4 KiB
1.4 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 660f447efc0e722f016c1be0 | Step 81 | 1 | step-81 |
--description--
The text has appeared again! This is because "false" is a string, which when evaluated to a boolean becomes true. This means "false" is a truthy value.
A truthy value is a value that is considered true when evaluated as a boolean. Most of the values you encounter in JavaScript will be truthy.
A falsy value is the opposite - a value considered false when evaluated as a boolean. JavaScript has a defined list of falsy values. Some of them include false, 0, "", null, undefined, and NaN.
Try changing your if condition to an empty string "", which is a falsy value.
--hints--
Your if statement should have "" as the condition.
assert.match(__helpers.removeJSComments(code), /if\s*\(\s*("|')\1\s*\)/);
--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));
}*/
--fcc-editable-region--
if ("false") {
console.log("Condition is true");
}
--fcc-editable-region--
let result = ""
for (const row of rows) {
result = result + "\n" + row;
}
console.log(result);