Learn Introductory JavaScript by Building a Pyramid Generator - Step 25

Tell us what’s happening:

After reading the forum posts and finding reviews and solutions online, I still can’t decipher what to do here. If someone can help i would really appreciate it. :smiley:

Your code so far

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

// User Editable Region

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

// User Editable Region

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 25

Hi there and welcome to our community!

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

You haven’t used the existing rows.push() but created another one. You can declare the variable pushed and assign it the existing code, within a single line.
Then you can console.log() the variable on the following line.

Hey there, thank you for the welcome! I did everything as you said and declared the pushed variable and assigned it to rows.push(“freeCodeCamp”);…but it still comes out as an error and creates the prompt “You should assign rows.push("freeCodeCamp") to your pushed variable.”. But your reply has given me some new knowledge. Thanks again!

Could you show us what you tried please?