when you say learn it for work, do you mean as of making a career out of it? there are different paths depending on what your goals are (front end, back end, both, etc.) if you want to design websites then you'll also have to learn HTML and CSS. as someone who recently became a full stack developer i can give you some advice as to how i started a few years ago with 0 programming knowledge.
in any case if you never coded before then CS50 is a great starting point which should teach you the basics and important concepts of all programming languages. it's a well structured course with lots of material and exercises. you can enroll for free on
edX and it even has its own
subreddit. i'd strongly recommend it because it will teach you a lot of invaluable things.
secondly,
MDN has pretty much everything you need to know on JS from beginners to advanced. to learn more in depth about concepts you can go
here.
here are some currently relevant paths on what important concepts you should learn if you ever get stuck:
-
https://www.youtube.com/watch?v=gVXcqO9A1vo (really cool and structured path)
-
https://github.com/P1xt/p1xt-guides
as for how i did it: i started with CS50 then did the old p1xt get job ready JS path and mixed it with some other courses that talked about the same topic as i was learning. recently the JS 2.0 path was released and you can do that instead. keep in mind that the p1xt guides are brutal and you will have to supplement them with additional material, however they will teach you the most out of anything you can find.
you might hear about things like
FCC and
Odin project (never tried it), however i found these types of courses, especially FCC, to be too easy and not as informative as the p1xt guide.