You need to do the same thing on the client and the server.
- DOM manipulation for AJAX states so they can be reached directly from the server without needing client side JS to do anything
- Calculate discounts for products (obviously clients just POST the product they want, but the discounts should be applied on the server consistently to how they were shown to the user)
- Your code is something generic, like recursively checking for a keypath on an object, and totally useful for JS anywhere it runs.
- DOM manipulation for AJAX states so they can be reached directly from the server without needing client side JS to do anything
- Calculate discounts for products (obviously clients just POST the product they want, but the discounts should be applied on the server consistently to how they were shown to the user)
- Your code is something generic, like recursively checking for a keypath on an object, and totally useful for JS anywhere it runs.
All kinds of other reasons.