Javascript is a favorite language for programmers to beat up on for a whole host of reasons. It's got a tricky syntax. You need to use wonky tricks at times to get it to behave. Asynchronous first is counterintuitive though necesary to prevent the GUI being locked during updates. It's original event-driven conception has left it's mark on the design. The list goes on. Most programming languages do not work like this.
Yet it has become a surprise favorite of sorts for backend development. Many websites have substantial parts of their infrastructure written in things like Node. In fact, Web frameworks like express get ~26 million downloads a week. This likely even supplants its inspiration. Possible "successors" include deno, a sophisticated second take on javascript in the backend. That such a thing exists proves the popularity of this approach.
So why did this happen?
There are three ingedients.
The Frontend is in javascript. Consumers have come to expect websites to have sophisticated user interfaces. Outside of a niche segment, people don't want the old style of "click-button-get-new-page". They want to click a button and have it seamlessly dissolve in response. Building such complex GUIs is hard. New frameworks like React have sprung up to help simplify this complexity and paper over some of javascript's more capricious qualities.
Second, the Full Stack Developer has become the expected norm. People don't focus on just one area anymore except in extremely specialized circumstances. Instead, they opt to learn a bit about every part of the stack. Should something out of their depth arise, they simply look it up. When building an MVP, such an engineer is likely good enough.
And finally, productivity is highest when you don't have to context switch. You have heads down time, focusing on the task at hand, banging out the solution one line at a time. This doesn't happen immediately. It takes a few hours to get into the flow.
All three are solved by Javascript-on-the-backend. One programming language that everybody has to know to build any website of sufficient quality. You stay with that one language all day and never have to context switch. That has proven to be a popular and important problem to solve.
Are there any other programming problems looking for solutions by new languages?