# A (Trivial) Mistake in the MDN Web Docs? August 6, 2020

For the Javascript function String.prototype.split(), the MDN web docs give the following interface:

str.split([separator[, limit]])

Curiously, they also make the following claim:

Notice in particular the center bullet: if limit is 1, str.split(separator)[0] is returned. I know Javascript has a messed-up type system, but this does seem to be a “type error.”1 Indeed, you can try the following in the console of any browser:

"Hello World!".split(" ", 1);  // ["Hello"]
"Hello World!".split(" ")[0];  // "Hello"

This is clearly just a silly typo, but it’s always neat to spot one out in the wild. I’ve archived a version of the original page that has this text.

Update: I made an issue in the MDN Github repository, but apparently it’s already been fixed. Loading the page now shows that it is indeed correct. Well, one day I’ll find a typo that no one has found before. If I’m lucky, it’ll be in one of Knuth’s books!

1. No clue why I’m bringing this up, but talking about types, particularly lists and singletons, brings to mind something cute I once saw on Math Overflow. Can you come up with sets $A$ and $B$ such that $A \subseteq B$ and $A \in B$ are both true?↩︎