Guide
Video
Resources
Sections:

Introduction

First-class Functions

pluralize

map

forEach

filterArray

eitherFilter

eitherCallback

reduce

intersection

union

objOfMatches

arrToObj

multiMap

majority

prioritize

countBy

groupBy

goodKeys

Conclusion

Sections:

Introduction

What is this guide about?

A callback is a function that gets passed into another function as an argument, and then invoked inside that outer function’s body. A higher-order function either returns a function, or accepts a callback as an argument. These two concepts seem relatively simple on the surface, but they can be the source of a lot of confusion for those who are new to programming. This guide is designed to help with that, by providing clear explanations and easy-to-follow JavaScript code walkthroughs for each problem in CSX’s Callbacks & Higher Order Functions module.

This guide's table of contents can be found to the left; either currently visible or within the menu (☰) depending on your window size. You'll find the search bar and a link to the video version of this guide in the header, either currently visible or within the upper right menu (⋯).

Who is this guide for?

CSX is an online platform and community where people learn the very basics of JavaScript, usually to prepare for entrance into the Codesmith coding bootcamp. Many people in this community have shared that while they’ve understood the first few sections of the CSX course, the transition into the callbacks module has left them “discouraged”, “struggling”, “confused”, or “frustrated”. The perceived difficulty spike is very real, so while this guide is not affiliated with Codesmith or CSX, it’s here to show you that you can get through these challenges with full understanding!

Prerequisites

To fully understand the material in this guide, you’ll need to have completed the following modules on CSX:

If you haven’t completed those, then at the very least you’ll need a solid grasp on the materials covered in those modules:

Plenty of additional concepts and syntax will naturally come up as we progress through this guide, but they will all be explained in detail. However, those explanations will assume a working knowledge of all the aforementioned basics.

Besides the prerequisites, it's important that you work through the sections of this guide in order. Each walkthrough builds on ideas established in prior sections, so you will find frequent references to prior content throughout this guide.

Now, let's begin with the first section, where we'll lay the groundwork for the entire course by diving into the most important concept behind every challenge we'll solve: functions as first-class citizens.