Comment

Comment by oneeyedpigeon

> Trivia: the JavaScript spec people wanted to name it contains, but this was apparently already used by Mootools so they used includes

That sounds ... unfortunate, to say the least. Why is the language spec. beholden to one framework written in that language? Doesn't mootools [1] check first for functions it might be overriding?

> Emojis and other double-byte chars are represented using multiple bytes of unicode. So padStart and padEnd might not work as expected!

It's a shame this isn't followed up on. What's the solution? Only use ASCII? Don't use padStart/padEnd? Does anyone know anything about monospace fonts and any guarantees they make wrt. unicode?

[1] https://mootools.net/core/docs/1.5.2/Types/Array#Array:conta...

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton