← Back to archive

Stdle #37 · namespaces · 2026-07-13

What does this TypeScript snippet output?

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

class Point { constructor(public x = 0) {} }
namespace Point { export const origin = new Point(0) }
console.log(Point.origin.x, new Point(7).x)
Namespaces
4 attempts left

Answer & explanation