---
id: 665732da4815b70bb083915e
title: Step 24
challengeType: 1
dashedName: step-24
---


# --description--

In the last few steps, you learned all about working with arrays. Take a moment to review what you have learned.

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.

When done correctly, you should see this output in the console.

```js
[ "London", "New York", "Mumbai" ]
[ "London", "New York", "Mexico City" ]
```

# --hints--

You should use `let` to declare a `cities` variable.

```js
assert.match(code, /let\s+cities/);
```

You should assign an array of the strings `"London"`, `"New York"`, and `"Mumbai"` to the `cities` variable.

```js
assert.match(code, /let\s+cities\s*=\s*\[\s*("|'|`)London\1\s*,\s*("|'|`)New York\2\s*,\s*("|'|`)Mumbai\3\s*,?\s*\]/);
```

You should use `console.log()` to log the entire `cities` array to the console.

```js
assert.match(code, /console\.log\(\s*cities\s*\)/);
```

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]`.

```js
assert.deepEqual(cities, ["London", "New York", "Mexico City"]);
```

You should have two `console.log(cities)` statements in your code.

```js
assert.lengthOf(__helpers.removeJSComments(code).match(/console\.log\(\s*cities\s*\)/g), 2);
```

# --seed--

## --seed-contents--

```js
let character = 'Hello';
let count = 8;
let rows = ["Naomi", "Quincy", "CamperChan"];
--fcc-editable-region--

--fcc-editable-region--
console.log(rows);
```
