Learn Introductory JavaScript by Building a Pyramid Generator - Step 24

Tell us what’s happening:

not sure why this isn’t working i look in my console window and the array looks correct

Your code so far

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

// User Editable Region

let rows = ["Naomi", "Quincy", "CamperChan"]

// User Editable Region

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

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 24

Capitalize the word City so that the test can see you used the same name.

it did not like the capital c i got even more errors

You should use

let

to declare a

cities

variable. 2. You should assign an array of the strings

"London"

,

"New York"

, and

"Mumbai"

to the

cities

variable. 3. You should use

console.log()

to log the entire

cities

array to the console. 4. You should update the last element of the

cities

array to the string

"Mexico City"

. Remember that you can access the last element of an array using

array[array.length - 1]

. 5. You should have two

console.log(cities)

statements in your code. // tests completed

Hi @ryanstruckus

If I capitalise the word city in the string, the tests pass.

Please post your update code if you receive any errors.
Also include the error message.

Happy coding

Make sure you use the word City not city here. Also remove the extra space character between the variable cities and the bracket.