← Back to archive

Stdle #160 · narrowing · 2026-11-13

What does this TypeScript snippet output?

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

class A {}
class B extends A {}
const x = new B()
console.log(x instanceof A && x instanceof B)
Narrowing
4 attempts left

Answer & explanation