Learn Introductory JavaScript by Building a Pyramid Generator - Step 22

Tell us what’s happening:

I can’t understand to mistake. In the test the last variable is coming but the code is not passing.

Your code so far

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

// User Editable Region

let rows = ["Naomi", "Quincy", "CamperChan"];
rows.push("freeCodeCamp");
let poppedValue= rows.pop();
console.log("poppedValue:",poppedValue);

// User Editable Region

Your browser information:

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 22

1 Like

Hi there! You have to declare a popped variable, not a poppedValue, then log it:
console.log(variable)

The console.log(variable) is not working. It is saying log your popped variable. what is my popped variable?

It’s just an example. Like said in the instuctions,

log your popped variable.

I don’t know what my popped variable is. I tried freeCodeCamp and camperChan but it didn’t work.

You have it in this line, just fix the variable name

I did . still not working

So share your latest code

let rows = [“Naomi”, “Quincy”, “CamperChan”];

rows.push= (“freeCodeCamp”);

let popped = rows.pop();

console.log(“freeCodeCamp”);

No need to log “freeCodeCamp”

And no need for = here

let rows = [“Naomi”, “Quincy”, “CamperChan”];

rows.push(“freeCodeCamp”);

let popped = rows.pop();

console.log();

Here still doesn’t work.

Console.Log the popped variable

MOD EDIT SOLUTION REMOVED

like that

Log the Variable name popped to the console.

It worked. Thank you

Your welcome. Happy Coding.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.