Learn Introductory JavaScript by Building a Pyramid Generator - Step 26

Tell us what’s happening:

The directions are VERY Unclear.
My Code:
let rows = [“Naomi”, “Quincy”, “CamperChan”];
rows.push(“FreeCodeCamp”)
console.log(rows);

Correct code:
let rows = [“Naomi”, “Quincy”, “CamperChan”];
rows.push(“freeCodeCamp”);
let popped = rows.pop(popped);
console.log(popped);
console.log(rows);

Not once in these 26 lessons has “popped” been mentioned once but somehow a person who’s day 2 into javascript is supposed to figure this out???

Your code so far

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

// User Editable Region

let rows = ["Naomi", "Quincy", "CamperChan"];
rows.push("FreeCodeCamp")
console.log(rows);


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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 26

Use .push() to add the string "freeCodeCamp" to the end of your rows array. Add this code before your console.log so you can see the change you made to your array.

I don’t see anything about “popped” in the Step you are on?

Thats what I mean. Theres nothing that says use “popped”, but looking at another post and they use let popped and it worked for them.
Correct answer is
let rows = [“Naomi”, “Quincy”, “CamperChan”];
rows.push(“freeCodeCamp”);
let popped = rows.pop(popped);
console.log(popped);
console.log(rows);

But nothing in the instructions say anything about using popped. I know this course is still in beta, but asking someone to figure out something they haven’t been taught yet is bad teaching.

You shouldn’t copy code from other posts. Sometimes the steps get renumbered as more get added. I would try to follow the instructions as written.

This absolutely is not a correct answer for the linked step.

I don’t want to copy code from other posts but it would’ve been impossible to answer step 26 if I hadn’t. That code worked for me , it didn’t work for you?

No, because that code is a syntax error. And you should not copy that wrong code. You should talk to humans on the forum instead of copying answers you find.

Specifically, these two lines have nothing to do with the instructions and should not be there.

Okay i’m going to go back to the lesson and try to figure it out without using popped then.

1 Like

Your original code has the string “FreeCodeCamp”
freeCodeCamp should be in camelcase, “freeCodeCamp”
There is nothing about declaring a popped variable in this step.