Javascript debugging is done in the browser using the built-in developer tools. People typically use chrome. The exception would be if you have a node application or javascript front end application built on vue or react etc. but in that case you are going to have the front end code separate from the back end code, and be implementing a REST api or something similar on your backend, which is basically what you would want to do for any ajax calls.
If you have lots of mixed PHP/HTML scripts you can still debug those with the PHP debugger, but it's really not a great way to develop clean maintainable code.
Most pro developers use PHPStorm. It's not free obviously, but it's the premier solution. It has so many options it can actually be pretty daunting, but it also provides the best navigation through a complicated code base of any IDE. As for free options, I have also used phpeclipse, which is built on top of eclipse. It's not terrible, as Zend for a time had a commercial product based on it, but Zend no longer exists as a company. Lately I'm using Visual Studio Code, but I haven't made a lot of efforts to get it setup for PHP. It's really where a lot of the web development community has migrated, and the support and velocity of enhancements is very high.