All challenges

TypeScript · medium

Forgot to await

#28

Situation

Onboarding emails say "Welcome undefined". welcome treated a Promise like a user object and asked it for .name like it owed you rent.

Objective

The greeting must use the loaded user's name. welcome(7) resolves to "Welcome, Ada" (not "Welcome undefined").

The repo at start

workspace/
└── src/
    └── greeter.ts   (welcomes "Welcome undefined")

Checks you will turn green

  • exports welcome
  • welcome(7) greets Ada
  • an unknown id greets Anon

Concepts

async-awaitpromises

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 28

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 28
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 28
  5. 4 And to update when a new version ships:
    sharpen update