Learn Introductory JavaScript by Building a Pyramid Generator - Step 24

Tell us what’s happening:

let cities = [“London”, “NewYork”, “Mumbai”];
cities[2] = “Mexico City”
console.log(cities);
console.log(cities[cities.length-1])
not able to solve this challenge

Your code so far

let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];

// User Editable Region

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



// User Editable Region

console.log(rows);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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 24

the order of statements is not the one requested by this step. Please review the instructions again.

Start by declaring a cities variable and initializing it as an array of the strings "London", "New York", and "Mumbai". Then log that variable to the console.

After logging, change the last element of cities to the string "Mexico City", then log the cities variable again.

Edit: there are also other mistakes in spelling and in the code.
You should use the exact spelling required and refer to the hints section for more help.