← Back to archive

Stdle #31 · classes · 2026-07-07

What does this TypeScript snippet output?

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

abstract class Base {
tag: string;
constructor() { this.tag = 'base'; }
abstract go(): string;
}
class Impl extends Base { go() { return this.tag + '/impl'; } }
console.log(new Impl().go());
Classes
4 attempts left

Answer & explanation