---
id: 69a0102e761a245bb1cbd8e7
title: Step 5
challengeType: 1
dashedName: step-5
---

# --description--

At this point, you should test the linked list for better understanding.

Create a `myList` variable and set it to `initList()`. Under it, log a call of `isEmpty()` using `myList` as the parameter to the console. Then, after that, call `add` with `myList` and a number of your choice, then log `myList` to the console. Under that, log another call of `isEmpty()` to the console using `myList` as the parameter again.

# --hints--

You should create a `myList` variable set to `initList()`.

```js
assert.deepEqual(myList, initList());
```

You should log a call to `isEmpty(myList)` to the console.

```js
assert.match(__helpers.removeJSComments(code), /console\.log\(isEmpty\(myList\)\);?/)
```

You should call `add` with `myList` and a number of your choice as the parameters.

```js
assert.match(__helpers.removeJSComments(code), /add\s*\(\s*myList\s*,\s*\d+\s*\)/);
```

You should log your `myList` variable to the console.

```js
assert.match(__helpers.removeJSComments(code), /console\.log\(myList\);?/)
```

You should log `isEmpty(myList)` to the console again.

```js
assert.match(__helpers.removeJSComments(code), /console\.log\(myList\);?\s*console\.log\(isEmpty\(myList\)\);?/)
```


# --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
    };
}

--fcc-editable-region--

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