My recipe for being a successful freelancer is to write clean, tested, maintainable code, PLUS specialize in some kind of niche. I mean specialize like crazy. I feel that employers like to hire polygot programmer employees because they envision them doing different things over a long period of time. But clients hire freelancers for very specific purposes and they only care about the immediate need right in front of them.
For example, my speciality is improving existing web applications written in python with Django or Flask frameworks. I can talk all day about monitoring errors in production, reducing response times, adding features, or improving app reliability, etc. But if someone asks me to support data science, build a new app from scratch, or an alexa skill, I decline.
You can definitely do well with Javascript, but again, I would be really good at one framework, such as Angular or React. Then I would focus that skill on a particular industry.