liveBook · Manning

Nothing

As explained in Functional Programming in JavaScript

A Maybe case that represents the absence of a value or a failure without extra detail.

Nothing marks the empty case in Maybe: a missing value, or a failure with no extra detail. It keeps the result in the same shape so later steps can stay simple.

It replaces nested null checks with a value that can be mapped over or unwrapped safely. When nothing is there, downstream code can fall back with getOrElse instead of throwing.

How Functional Programming in JavaScript covers it

How deep it goes
Defines the empty Maybe case and shows how it preserves map chains and fallback handling, but not custom Nothing internals.
Examples
Uses safe student lookup, chained property access, and the error 'Can't extract the value of a Nothing.'
What it assumes
Assumes basic null checks and introduces Maybe and its empty branch from scratch.
What you can do after
Apply Maybe to keep missing data explicit while chaining operations and supplying defaults.
How it connects
Connects to Maybe, Just, map, getOrElse, fromNullable, and null handling.

Also explained in

Compare how 2 books explain Nothing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Programming in JavaScript. The section links point to the parts of the book it draws on.