Learn Introductory JavaScript by Building a Pyramid Generator - Step 27

Tell us what’s happening:

how assign rows.push(“freeCodeCamp”) to pushed variable ??

Your code so far

let character = 'Hello';
let count = 8;

// User Editable Region

let rows = ["Naomi", "Quincy", "CamperChan"];
rows.push("freeCodeCamp");
let pushed;
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 27

1 Like

To assign it, use the equal sign. For eg.

let variable = something;

Hi there. You are supposed to set the variable pushed equal to the result of rows.push("freeCodeCamp");. You see that method actually returns a value. Following that, you are supposed to log the value of pushed to the console.

Thanks for the tip ,the code worked perfectly. :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1:

1 Like