Back to Freecodecamp

Step 80

curriculum/challenges/english/blocks/learn-introductory-javascript-by-building-a-pyramid-generator/660f4455f457ef2e3ec6920f.md

latest915 B
Original Source

--description--

Now the string is no longer printing, because false is not true. But what about other values?

Try changing the condition to the string "false".

--hints--

Your if statement should have the string "false" as the condition.

js
assert.match(__helpers.removeJSComments(code), /if\s*\(\s*('|")false\1\s*\)/);

--seed--

--seed-contents--

js
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 + row + "\n";
}

console.log(result);