Learn Introductory JavaScript by Building a Pyramid Generator - Step 82

Tell us what’s happening:

Hello friend
Who can help me with step 82
I wrote this else if(" "){“5 is less than 10”}

Your code so far

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));
}*/


// User Editable Region

if ("") {
  console.log("Condition is true");
else if (check 5less than 10)){console.log("5 is less than 10")}

// User Editable Region


let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 82

1 Like

Hi @fate1

You have syntax errors you need to first fix.

This condition will not work.

  1. remove the word check
  2. replace less than with a < (less than sign)

Happy coding

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.