First of all, learning other programming languages is always a good thing. There are many reasons for this:
- Learning new languages makes it easier for you to learn other new languages in the future - and sooner or later in your career you will almost certainly want to or need to.
- Learning new languages helps you understand the language you're already working in. If I told you JavaScript is a dynamically-typed language, would that mean anything to you? Probably not so much if you've never used a statically-typed language. If I told you it has first-class functions, would that mean anything to you? It's like telling someone "night is dark" when they've never seen daylight.
- Learning new languages teaches you about ideas from other languages that may eventually make it into your language. ECMAScript 6 added "arrow functions" to JavaScript, these are also known as lambdas and would already be familiar to you if you've used C# (from version 3 onwards), Java (from version 8 onwards), Scala, Haskell, or many other languages.
- Learning new languages teaches you different ways to think about code. And this can only make you a better coder.
- Learning new languages increases your employment opportunities.
- Learning new languages is fun!
In addition to these, and other benefits I've surely omitted, there's this which is directly relevant to your question about machine learning in particular.
- Different languages have different libraries and different communities of users that use them for different purposes. Most people doing machine learning aren't working primarily in JavaScript. Some are working in Python, some are working in R, some are working with Spark using Scala or Python, etc.
If you already know JavaScript, then learning Python shouldn't be too hard for you, and it has some great machine learning libraries like scikit-learn, with lots of great resources online to help you learn. So I'd recommend starting there. But I also recommend that you eventually branch out and learn some languages that are further outside your comfort zone.