← Back to archive

Stdle #151 · quirks · 2026-10-29

What does this JavaScript snippet output?

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

const users = [{ role: 'a' }, { role: 'b' }, { role: 'a' }];
const g = Object.groupBy(users, u => u.role);
console.log(g.a.length, g.b.length);
Quirks
4 attempts left

Answer & explanation