---
id: 69c918841987bf16c1d1babe
title: Step 7
challengeType: 1
dashedName: step-7
---

# --description--

The distance from the starting node to itself is always `0`. You have to update the `distances` array to reflect this.

After the `distances` array, set `distances[startNode]` to `0`.

# --hints--

You should set `distances[startNode]` to `0`.

```js
assert.match(
  __helpers.removeJSComments(shortestPath.toString()),
  /distances\s*\[\s*startNode\s*\]\s*=\s*0/
);
```

# --seed--

## --seed-contents--

```js
const INF = Infinity;
const adjMatrix = [
  [0, 5, 3, INF, 11, INF],
  [5, 0, 1, INF, INF, 2],
  [3, 1, 0, 1, 5, INF],
  [INF, INF, 1, 0, 9, 3],
  [11, INF, 5, 9, 0, INF],
  [INF, 2, INF, 3, INF, 0],
];

function shortestPath(matrix, startNode, targetNode = null) {
  const n = matrix.length;
  const distances = new Array(n).fill(INF);
--fcc-editable-region--
  
--fcc-editable-region--
}
```
