← Back to archive

Stdle #76 · narrowing · 2026-08-21

What does this TypeScript snippet output?

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

class Animal {}
class Dog extends Animal {}
const d: Animal = new Dog()
console.log(d instanceof Animal)
Narrowing
4 attempts left

Answer & explanation