You need to do the same thing on the client and the server.<p>- DOM manipulation for AJAX states so they can be reached directly from the server without needing client side JS to do anything<p>- 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)<p>- Your code is something generic, like recursively checking for a keypath on an object, and totally useful for JS anywhere it runs.<p>All kinds of other reasons.