Lesson 4.1

The reason-phrase table

The status line ends in a human word, and a missing word turns into the literal token undefined on the wire. Build the small module of wire data that makes that bug impossible.

20 minsrc/status.js
  • Name the three tokens of an HTTP status line and say which one is decorative.
  • Explain why a reason-phrase lookup must be a total function and how ?? supplies the fallback.
  • Build a null-prototype status table and a reasonPhrase lookup that never emits undefined.
Locked

This chapter is part of the framework capstone. Chapters 1 and 2 are free to build - unlock the rest to keep going.

Unlock the depth