---
id: 69a00cd4ec513345d40e95ec
title: Step 2
challengeType: 1
dashedName: step-2
---

# --description--

The next thing you will work on is a function that lets you check if the list is empty.

To do that, create a function named `isEmpty` that takes a `list` parameter. Inside the function, return a check to see if the `length` property of `list` is strictly equal to `0`.

# --hints--

You should create an `isEmpty` function.

```js
assert.isFunction(isEmpty)
```

Your `isEmpty` function should have a `list` parameter.

```js
const isEmptyParams = __helpers.getFunctionParams(isEmpty.toString());
assert.deepEqual(isEmptyParams[0].name, "list");
```

Your `isEmpty` function should return `list.length === 0`.

```js
const emptyList = { head: null, length: 0 };
const nonEmptyList = { head: {}, length: 1 };

assert.isTrue(isEmpty(emptyList));
assert.isFalse(isEmpty(nonEmptyList));
```

# --seed--

## --seed-contents--

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

--fcc-editable-region--

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