← Back to archive

Stdle #51 · namespaces · 2026-07-27

What does this TypeScript snippet output?

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

class Animal { kind = 'cat' }
namespace Animal { export const count = 3 }
console.log(new Animal().kind, Animal.count)
Namespaces
4 attempts left

Answer & explanation