Side effect free client-side/server-side (Node.js) JS object key search