Earlier quoted context omitted.
Form validation.
Form validation doesn't need to be done in Javascript. I'd argue that it shouldn't ever be done in Javascript, because that means implicitly trusting the client, which is always a bad idea. Since any sane application revalidates the response on the server anyway, client side validation is just a gimmick, it's not necessary.
We create a worse user experience by waiting until the form is submitted to inform the user of some silly error.
For some applications, the difference isn't that big, but for many it brings a significant improvement.
Is it possible to create crappy client side validation? E.g. not letting the user temporarily input invalid data while filling out the form, or displaying over-the-top red error indicators everywhere as soon as a single mistake is made, etc... Definitely. But let's not throw the baby out with the bathwater.
The backend should never trust the client, of course. That is a separate goal of the application, however.