if I wanted to answer this question , I would look up the text books that my favorite university is using for various classes…
Here are some random resources…
Just one caveat: understanding aspects of CS may help greatly with programming in general, having a good grounding in it is a Very Good Thing, etc. But, it’s [arguably] not really going to help with day-to-day JS. JS is a practical scripting language, mainly there to allow interaction with web browsers. It’s very high-level and is generally detached from the nuts and bolts of how computers (and maths behind them) work. For example, you mention threads: JS has one thread, that’s it, so knowing how to use threads has no real practical use in JS. Knowing how to write compilers: again, very little practical value w/r/t JS. Algorithms, more useful, but JS has a very limited toolset: you can’t drop into low level code, the number of data structures available to you is 1, the language is not good at maths, etc.
Some stuff definitely will though. Regarding books, the ones I would recommend unequivocally (the language they use I’ve put in brackets, though it’s mainly irrelevant):
- Structure and Interpretation of Computer Programs (Lisp)
- Designing Programs (Racket)
- Concepts, Techniques and Models of Computer Programming (Oz)
And this course, which is the best online course I’ve ever done (has a part B and C as well, languages are ML, Racket and Ruby). It has the best explanation of closures I’ve ever been given, for one thing:
One more thing Dan , i noticed that many courses swing between different languages like the one you gived me , how can i learn JS while i’m studying Ruby or Lisp
The point of CS is not to learn a language, I think that was one thing I should have said: it’s important to emphasise this. It’s not particularly relevant in a lot of cases because you’re not learning to learn a language, you’re using a language as a tool to understand a general concept.
JS is a pretty complex, very high level language that doesn’t really work in the same way as most other languages, and is not a particularly good language for learning concepts. It sometimes gets used for teaching because it’s available everywhere (and it’s really good at some things - visualising stuff for example), but most CS learning stuff is not going to be JS.