Differences among js server, js client, js all


I understand js server functions are executed in the server, js client are executed in the client, and js all can be executed in either. But what kind of function should be js server, js client, and js all?



js server should be used for functions that need a lot of processing power or are “close to the data” i.e they create and/or fetch large amounts of data.

js client should be used for functions which only make sense to run in the client (maybe they manipulate the DOM)

js all is useful for “utility” type functions that are mostly simple logic and can run anywhere.