In my opinion buying it's not worth it, doesn't matter which language you're learning.
There are so many free resources online that you can learn from.
Youtube of course is full of videos as someone already mentioned.
I remember when i first started coding i used Codecademy but that was something like 8 years ago, now i see they have plans, i don't know how much you can get with a free plan but it's worth checking.
Also i just checked KhanAcademy, they have a Computer Programming course that seems to teach programming using Javascript (good for you since you're learning web dev), then goes into HTML/CSS, HTML/JS, and some SQL too, completely free.
If you mean Wordpress theme/plugin development Wordpress is written in php so as long as you learn php you shouldn't need a course to learn Wordpress.
If you check Wordpress online documentation they have guides for getting into theme/plugin development and there are a lot of guides, articles and websites in general that talk about Wordpress development.
Also let's not forget StackOverflow and
https://wordpress.stackexchange.com/ where there are a ton of threads of people that might have the same problems you encounter so if you ever get stuck you shouldn't have big problems getting unstack as long as you put in the effort.
But before going into web dev or anything i always suggest and i believe it's important to learn programming logic and one programming language to have a solid foundation/background to start from.
At least that was the case for me, i had a solid foundation in programming and when i came to web dev it was not that hard to learn.