You have multiple options:
- JSFiddle for trying out your JS code in an online environment and sharing it with others for debugging purposes.
- On desktop, any JetBrains IDE would do once you enable syntax completion for JS and PHP. I’ve been using Webstorm for a while now, and it’s pretty good. Also, I was surprised by how well JS syntax completion worked in PyCharm. So, you can’t go wrong with any JetBrains IDE.
- Check out Brackets. It’s an editor that has some interesting design support.
- Use chrome dev tools for JS stuff. As most JS is client side (exception: Node, etc.), this helps a lot in debugging.