Javascript has the requirement of backwards compatibility. The limitation is not technical. It's disingenuous to suggest it's so simple to replace these things or it's extremely naive.
Look at the recent HTTP redirect article for example. Something as simple as redirects have been implemented incorrectly for a long time. Browser vendors are well aware of it, but they cannot change the behavior because it will break every existing site that expects the broken behavior.
You should be more impressed with the things that last 20 years, not embarrassed. It means they were actually engineered well enough to be a good general solution.