---
id: 69a0179a85b00b6127e0af45
title: Step 10
challengeType: 1
dashedName: step-10
---

# --description--

Inside the `while` loop, update `current` to `current.next` so the loop moves forward through the list one node at a time, and stops when it reaches the node with a `next` property of `null`, that is, the end of the list.

# --hints--

You should update the value of your `current` variable to `current.next` inside the `while` loop.

```js
assert.match(__helpers.removeJSComments(add.toString()), /current\s*=\s*current\.next;?/);
```

# --seed--

## --seed-contents--

```js
function initList() {
    return {
        head: null,
        length: 0
    };
}

function isEmpty(list) {
  return list.length === 0;
}

function add(list, element) {
    const node = {
        element: element,
        next: null
    };

    if (isEmpty(list)) {
        list.head = node;
    } else {
        let current = list.head;
        while (current.next !== null) {
            --fcc-editable-region--

            --fcc-editable-region--
        }
    }

    list.length++;
}

const myList = initList();
console.log(isEmpty(myList))
add(myList, 42);
console.log(myList)
console.log(isEmpty(myList))
```
