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.
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.
Your original code has the string “FreeCodeCamp”
freeCodeCamp should be in camelcase, “freeCodeCamp”
There is nothing about declaring a popped variable in this step.