Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Express Basics!
You have completed Express Basics!
Preview
The `next` function is an important part of middleware. Learn why and when to use it.
More about closures
- Understanding Closures in JavaScript (Treehouse workshop)
- Closures (MDN articles)
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
First, next signals the end
of middleware functions.
0:00
Here's the state of the code
we left off in the last video.
0:05
I'll change the two functions
to log strings again.
0:08
The first one to log, Hello.
0:13
And the second one will log, world.
0:21
Let's see what happens when I remove
next from the first function.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up