It"s the very strange mix of very bad ideas and very good ideas that's baffling. Some other languages are homogeneously bad (php) but provides less suprises than js, because of their regularity. js is bipolar/schizophreniac.
It basically contains its entire history, from a PHP-like hack job that started it to the very elegant ES6/7. It's probably one of the few languages that expose their whole fossil record.