← Back to archive

Stdle #113 · namespaces · 2026-09-27

What does this TypeScript snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

function api() { return 'root' }
namespace api { export namespace v2 { export const path = '/v2' } }
console.log(api(), api.v2.path)
Namespaces
4 attempts left

Answer & explanation