---
id: 66c645b345a39bf04864dc50
title: Step 5
challengeType: 1
dashedName: step-5
---

# --description--

To see the updated shopping list, you will need to log the current shopping list and a short message to the console.

Since this message will be used repeatedly throughout the workshop, it is best to create a reusable function.

Create a function called `getShoppingListMsg` that takes an array as a parameter and returns the string `"Current Shopping List: "` followed by the contents of the provided array.

You can use template literals or string concatenation with the `+` operator to combine the string with the array passed to the function.

# --hints--

You should have a function called `getShoppingListMsg` in your code.

```js
assert.isFunction(getShoppingListMsg);
```

Your `getShoppingListMsg` function should return a string.

```js
assert.isString(getShoppingListMsg(shoppingList));
```

Your `getShoppingListMsg` function should accept an array and return the message `"Current Shopping List: "` followed by the contents of that array. Double check spacing and spelling errors.

```js
assert.oneOf(getShoppingListMsg(["Anchovies", "Olives"]), ["Current Shopping List: Anchovies,Olives", "Current Shopping List: Anchovies, Olives"]);
assert.strictEqual(getShoppingListMsg(["Apples"]), "Current Shopping List: Apples");
```

# --seed--

## --seed-contents--

```js
console.log("Grocery shopping list");

const shoppingList = [];

console.log("It will be nice to have some fruit to eat.");

shoppingList.push("Apples");

--fcc-editable-region--

--fcc-editable-region--
```
