I've been doing JS for 18 years. I don't think it particularly deserves to be learned but I think in general you should know a scripting language and JS is very popular (and can be embedded with v8 isolates fairly easily).
If you know python or lua I wouldn't bother. Lua would probably be my first choice.
Scripting languages are faster for prototyping but they are a nightmare for maintenance. TypeScript might look like a good middle ground but the many escape hatches really allow you a single bad coder to wreck havoc in your codebase. You can't trust a codebase you don't know in TypeScript the same way you would trust a Rust codebase.
JS is good for job security because the node.js hype cycle brought a lot of JS in enterprise places - it's been used for massive codebases and now there are plenty of microservices nobody wants to touch or know how to debug. The rise of horrible, enterprisey frameworks (eg. NestJS) helped this.
JS could be the COBOL of the next generation, if it weren't for the web, which will likely keep JS alive for a long time.
If you really want to learn JS, focus on the good parts.
Avoid classes and `this`, avoid prototypal inheritance.
Postpone the frontend as much as you can as that changes every 5 minutes.
Start with bun (if you have no dependencies on node, it's not really compatible), so you'll have no issues with imports / require and all the tooling / transpiling (which rightly give JS a bad name)
Scripting languages are faster for prototyping but they are a nightmare for maintenance. TypeScript might look like a good middle ground but the many escape hatches really allow you a single bad coder to wreck havoc in your codebase. You can't trust a codebase you don't know in TypeScript the same way you would trust a Rust codebase.
JS is good for job security because the node.js hype cycle brought a lot of JS in enterprise places - it's been used for massive codebases and now there are plenty of microservices nobody wants to touch or know how to debug. The rise of horrible, enterprisey frameworks (eg. NestJS) helped this. JS could be the COBOL of the next generation, if it weren't for the web, which will likely keep JS alive for a long time.
If you really want to learn JS, focus on the good parts.
Avoid classes and `this`, avoid prototypal inheritance.
Postpone the frontend as much as you can as that changes every 5 minutes.
Start with bun (if you have no dependencies on node, it's not really compatible), so you'll have no issues with imports / require and all the tooling / transpiling (which rightly give JS a bad name)