Learn Introductory JavaScript by Building a Pyramid Generator - Step 99

Tell us what’s happening:

Start by creating a new for loop. Declare your iterator i and assign it the value of count, then use the boolean false for your condition and iteration statements.
This is the condition .
I really cant process the question as i am been stuck

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

/*while (rows.length < count) {
  rows.push(padRow(rows.length + 1, count));
}*/


// User Editable Region

for(let i = count,i = false , i++){
}


// 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 99

alrighty. It seems the instructions are asking for a loop to be created.
Can you start there and show us how you create one?

is it :
false;
or i === false ;
or i===0

That doesn’t look like enough code to be a loop.

hi @sonuipad05.if you give for loop keep this terms in your mind.
for(initialization;condition;iteration){ }

as i see your code your for loop structure is correct also your initialization,but for this you forget the correct symbol ‘;’.
then for condition& iteration (boolen), don’t use ‘increment’ .look at this example
that’s help you!

for (let i = value; true; true){
}

try to replace this example by observing the instraction.
happy coding!

Hi @Samuel-54

Thanks for your effort to help other members of the community.

Can I make a couple of observations to your post?
Where you wrote:

for(initialization;condition;iteration){ }

MODERATOR EDIT:
Another way to put it:
for(expression1; expression2; expression3){ }
where usually:
expression1 = initialization
expression2 = limit where the iteration must stop
expression3 = steps (very close to what Samuel-54 wrote)

And:

for (let i = value; true; true){
}

MODERATOR EDIT:
Suggestion above… hmmmm… I don’t know…

Can you do a bit more research, re-phrase the message and post a more convenient answer? I am sure you can :wink: !

Keep the hard work!