Well since you mentioned JS and Python,
Programming in Haskell [0] by Graham Hutton is a very approachable text book to familiarize yourself with topics about functional programming (just a personal favourite).
And of course there is the mother of all software books SICP [1] (yes, it's free) – which is often regarded as the CS text book. It is very information-dense and touches on many parts of CS.
However, if you're struggling to build things, I doubt that books will do much good, since they usually cover theoretical aspects. For this I could only recommend lots of tinkering and practice and little half-completed projects, unfortunately.
Do you have some specific examples of projects/libraries where you got stuck? Perhaps we can get a better understanding of what it is you feel you are lacking then...
[0] https://www.cs.nott.ac.uk/~pszgmh/pih.html
[1] https://mitpress.mit.edu/sites/default/files/sicp/index.html