Yes, that is tongue-in-cheek, but without JavaScript, web browsers would have found another language; without web browsers, JavaScript would long have been forgotten.
My memory is a bit foggy, but I recall Microsoft throwing a bunch of things at the browser in the beginning. You can specify the language in the script tag. VBScript anyone?
It wasn't like JavaScript didn't have competition ... it just won a very long time ago.
It had market penetration because it was included with Netscape Navigator.
Yes, it also was good enough at that time, but almost anything would have been, in a time where a ten-line script was huge. I do not think that it would have won against say VBScript if the latter would have been available on the same set of browsers.
I can think of one other, and for the same reason: make. Both languages are still around because it's near impossible to replace them, no matter how much they may suck. They aren't timeless, they're calcified by being a part of some infrastructure that exists on millions of machines.
Certainly this is mostly due to its unique position on the browser, but the language had to be flexible enough to fill that role and more. That's amazing.