Javascript: Can anyone explain me this block of code? : <p>i dont understand this two functions down below. They use an argument that is a function (done) and then they call the function inside of that function? Please tell me what type of function is this and how it works. Thank you!</p>

<pre><code>beforeEach((done) =&gt; {
    Todo.remove({}).then(() =&gt; done());
});

describe('POST /todos', () =&gt; {
    it('should creat a new todo', (done) =&gt; {
        var text = 'Test todo text';

        request(app)
            .post('/todos')
            .send({text})
            .expect(200)
            .expect((res) =&gt; {
                expect(res.body.text).toBe(text);
            })
            .end((err, res) =&gt; {
                if (err) {
                    return done(err);
                }

                Todo.find().then((todos) =&gt; {
                    expect(todos.length).toBe(1);
                    expect(todos[0].text).toBe(text);
                    done();
                }).catch((e) =&gt; done(e));
            })
    })
});
</code></pre>
