One of the most common questions I got asked as a JavaScript teacher was “what is reduce for?” It’s easy to peruse the web and see many examples of people using reduce to do very minimal things, but seeing how it’s actually used in action is much rarer to find. It’s possibly the most confusing of the built-in higher-order functions within JavaScript. While people can intuitively grep the usage of things like map, filter or sort, reduce has a less intuitive usage. This article does assume you have a basic understanding of higher-order functions and ES6 syntax.

MDN explains reduce

Part 2

In Part 1 we took a look at setting up the basic infrastructure for a web framework — namely serving up HTML files at specific route responses. If you haven’t read Part 1, I’d start there to get up to speed as we’ll be building on the application presented in that article.

Setting Up a Static Request Handler

In the previous section, we set up two different types of request handlers: a BadRequestHandler to manage 404s and other types of errors, and a TemplateHandler to send back our HTML file requests at specific URLs. …

Creating a Python3 Webserver From the Ground Up

Jumping into Python’s web code when your previous experience is mostly in web-based languages (PHP, Javascript, Ruby) can be a daunting task. Python has all of the tools available to make a strong HTTP Server or framework, as well as plenty of mature web frameworks to get started with, but the purpose of this tutorial/write-up isn’t to show you how to leverage those, but how to build one from the ground up (similarly to how you’d start learning with NodeJS) to give you a more complete understanding of how the components can fit together.

Throughout this tutorial, we’ll go through…

Andrew Klatzke

Programmer & Programming Teacher.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store