Learn Introductory JavaScript by Building a Pyramid Generator - Step 44

Tell us what’s happening:

i don’t understand the instructions and what should i write next code… it still wrong. i’ve been tried to push character variable.

Your code so far

const character = "#";
const count = 8;
const rows = [];


// User Editable Region

for (let i = 0; i < count; i = i + 1) {
  rows.push() + character.push;
  
}


// User Editable Region


let result = ""

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

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/133.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 44

to push something to the array you need to put it as argument of the push method

like what ? can you give an example ?

the starting code is pushing i to the array, I suggest you reset the step and start from that line

done. thanks for your help

When you use array.push(someValue); you are adding a value to the right or end of the array.

In this part of the statement rows.push() what are you pushing to the rows array?

const array = [ "this",  "is",  "an"];
console.log(array);   // prints to screen: [ "this",  "is",  "an"]
array.push("array");
console.log(array);  // prints to screen:  [ "this",  "is",  "an", "array"]

Should rows.push(should there be a value here that you are pushing to an arry?)