---
id: 69baafd6d683dd9921b75db3
title: Step 1
challengeType: 1
dashedName: step-1
---

# --description--

In this workshop, you will use JavaScript to simulate the flow of attendees at a music festival.

You will work with two datasets that describe the festival gates during morning and night shifts:

```js
const morningGates = [
  { id: "North", capacity: 5, queue: [3, 6, 2, 4] },
  { id: "East", capacity: 3, queue: [2, 4, 3, 5] },
  { id: "South", capacity: 4, queue: [1, 2, 3, 1] },
  { id: "West", capacity: 2, queue: [4, 1, 2, 3] },
];

const nightGates = [
  { id: "North", capacity: 4, queue: [6, 2, 5, 1] },
  { id: "East", capacity: 2, queue: [3, 3, 4, 2] },
  { id: "South", capacity: 5, queue: [2, 1, 2, 3] },
  { id: "West", capacity: 3, queue: [5, 2, 1, 4] },
];
```

Each gate object contains the following properties:

- `id`: A string that identifies the gate.
- `capacity`: The number of attendees the gate can process per tick.
- `queue`: An array of numbers representing how many attendees arrive at the gate during a specific tick.

To begin, create an empty function named `initializeThroughput` that accepts a parameter named `gates`.

# --hints--

You should create a function named `initializeThroughput`.

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

Your `initializeThroughput` function should have a `gates` parameter.

```js
const regex = __helpers.functionRegex('initializeThroughput', ['gates']);
assert.match(__helpers.removeJSComments(initializeThroughput.toString()), regex);
```

# --seed--

## --seed-contents--

```js
const morningGates = [
  { id: "North", capacity: 5, queue: [3, 6, 2, 4] },
  { id: "East", capacity: 3, queue: [2, 4, 3, 5] },
  { id: "South", capacity: 4, queue: [1, 2, 3, 1] },
  { id: "West", capacity: 2, queue: [4, 1, 2, 3] },
];

const nightGates = [
  { id: "North", capacity: 4, queue: [6, 2, 5, 1] },
  { id: "East", capacity: 2, queue: [3, 3, 4, 2] },
  { id: "South", capacity: 5, queue: [2, 1, 2, 3] },
  { id: "West", capacity: 3, queue: [5, 2, 1, 4] },
];

--fcc-editable-region--

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