Learn Introductory JavaScript by Building a Pyramid Generator - Step 28

Tell us what’s happening:

Did as mentored but couldn’t pass through this test…
feels like missing something please help!!!

STEP 28

let character = ‘Hello’;
let count = 8;
let rows = [“Naomi”, “Quincy”, “CamperChan”];

Step 28

Assign your existing rows.push() to a new pushed variable, and log it.

//user editable region//

rows.push(“freeCodeCamp”);
let pushed = rows.push(“freeCodeCamp”);

//end //

let popped = rows.pop();
console.log(popped);
console.log(rows);

Your code so far

let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];

// User Editable Region

rows.push("freeCodeCamp");
let pushed = rows.push("freeCodeCamp");

// User Editable Region

let popped = rows.pop();
console.log(popped);
console.log(rows);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 28

Assign your existing rows.push() to a new pushed variable, and log it.

The challenge was to use what is already there at the first line and assign that to the pushed variable.

Since you have already done that, delete the first line and you should pass.

for sure, don’t forget to log your pushed variable

1 Like

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