Many times have I stumbled at the same point. While an online course seems to be more up-to-date and relevant, a book is a classic and sometimes more prestigious.
My opinion is that it depends on the level of detail that you want to acquire from the language/ techonoly that you are learning.
An online course generally provides more examples and hands-on mini projects, while a book gives a deeper experience but focuses more on abstract paradigms.
My suggestion would be to try first an online course (just to get a grip and a general idea of the topic), and then to supplement your learning with a classic book.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.