4 ms·
All the TypeScript examples use "instanceof". That's what a pattern matching block like this would compile down to, surely. And pattern matching on literals (eg
by lobster_johnson 12y ago
All the TypeScript examples use "instanceof". That's what a pattern matching block like this would compile down to, surely. And pattern matching on literals (eg., [x|xs]) would also translate to perfectly adequate JavaScript.