Learn Introductory JavaScript by Building a Pyramid Generator - Step 24

Tell us what’s happening:

I have a problem in step 24, I solved the algorithm correctly, I checked it but the platform gives me an error in the code.

let cities [“London”, “New York”, “Mumbai”];
console.log(cities);
cities[cities.length - 1] = “Mexico City”;
console.log(cities);

Your code so far


// User Editable Region

let cities ["London", "New York", "Mumbai"];
console.log(cities);
cities[cities.length - 1] = "Mexico City";
console.log(cities);

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Learn Introductory JavaScript by Building a Pyramid Generator - Step 24

Welcome to the forum @JesusOlarte

The red squiggly lines indicate a syntax error.

s

The hint message is giving you a clue what the code is missing.

Happy coding

removed by mod

It worked this way. I was stuck on the same point.

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. How to Help Someone with Their Code Using the Socratic Method

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.

1 Like

I’ll be careful next time. Apologies, and thank you!