Learn Introductory JavaScript by Building a Pyramid Generator - Step 26

Tell us what’s happening:

Cant seem to figure out my error. Tried looking up “call” in JS but am still a bit confused on how to call my .pop method

Your code so far

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

// User Editable Region

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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 26

Here is the syntax to call an object’s method and store it in a new variable:

let variable = object.method()

I hope this helps!

Thanks man, was totally stuck on this for damn near an 30 mins.

1 Like

Tell us what’s happening:

I have no clue what i’m doing wrong.
what i got so far

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

what console gives me

// running tests
You should call the .pop() method.
You should call the .pop() method on your rows array.
// tests completed
// console output
[ ‘Naomi’, ‘Quincy’, ‘CamperChan’, ‘freeCodeCamp’ ]
undefined

Your code so far

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

// User Editable Region

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

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

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 26

what value should you give to this variable?

hi, how your code looks like in step 26?
I tired multiple times and I have no clue how it suppose to look like.
Tanks in advance!

this is the task:
Create a new variable called popped and assign it the result of rows.pop() . Then, log popped to the console.

I’m asking you, not the instructions. You need to assign a value to that variable, are you having issues with this?

I don’t know what value to assign.

got it, on my own.

–removed code

In the future, please create your own topic when you have specific questions about your own challenge code. Only respond to another thread when you want to provide help to the original poster of the other thread or have follow up questions concerning other replies given to the original poster.

The easiest way to create a topic for help with your own solution is to click the Ask for Help button located on each challenge. This will automatically import your code in a readable format and pull in the challenge url while still allowing you to ask any question about the challenge or your code.

Thank you.

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.