StaffCoder
Typescript
TypeScriptNode.js 24
3 modules · 13 challengesSign up
Modules3 modules · 13 challenges
Module 2 of 3 · 5 challenges

TypeScript Functions & Text

Learn to write typed functions and work with text by building a server log triage tool. Split log lines into fields, read numbers out of text without anything crashing, format sizes and counts into aligned columns, and pass functions around as reusable filters with optional and rest parameters and closures.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

5 challenges

Split the Log Line

Sign up to unlock
—No data yeteasy
About this challenge

Split a server access-log line into its six named fields, ignoring stray spaces and rejecting lines with the wrong shape.

Solved in a browser IDE and graded by tests. Sign up to solve

Read the Numbers

Sign up to unlock
—No data yeteasy
About this challenge

Read whole numbers out of log fields without ever crashing, and sort status codes into their families.

Solved in a browser IDE and graded by tests. Sign up to solve

Human-Readable Sizes

Sign up to unlock
—No data yeteasy
About this challenge

Render byte totals in B, KB and MB, group large counts with commas and line report columns up.

Solved in a browser IDE and graded by tests. Sign up to solve

Log Entry Filters

Sign up to unlock
—No data yeteasy
About this challenge

Build reusable log entry filters as functions that return functions, and combine them to answer narrow incident questions.

Solved in a browser IDE and graded by tests. Sign up to solve

Log Triage Report

STAR
Solving it completes the module
—No data yeteasy
About this challenge

Turn raw access-log lines into an incident triage report, composing given split, parse, format and filter functions.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.