The Reasons Behind JavaScript’s Success
fagnerbrack.com
fagnerbrack.com
* functions are first class citizens
* native lexical scope
* OOP optional
That's it, flexibility. Many people want to falsely claim because its the language of the browser or because of something to do with JSON. The rising popularity on a timeline of JavaScript does not support those false conclusions. For example JavaScript was around for more than a decade locked in the browser before it became popular and it was already becoming popular before JSON support was natively available.
It could never have survived on its own in the wild.
Javascript is not the first scripting language with C like syntax. Before Javascript there was LPC (C-like language for programming LPMud). https://en.wikipedia.org/wiki/LPMud And of course the C-like language within Awk where you can write things like:
function add(a, b)
{
return a + b;
}
LPC was cloned by a GPL-ed language called Pike in the mid 1990's. You don't hear about LPC or Pike today. (Part of the reason for which is probably the rise of Java to prominence in the area of "managed languages that look like C"). Awk is around because it's part of POSIX. It's the only language other than the shell you can count on being there.A Javascript developed as a project not connected to the web would likely receded into obscurity like Pike.
> It could never have survived on its own in the wild.
People continue to say that about Lisp and Haskell.
> A Javascript developed as a project not connected to the web would likely receded into obscurity like Pike.
That sounds like a logical fallacy. Surely the result would be different had the conditions not been the same, but guessing at a result derived from conditions that never happened is fantasy.