Introduction
res.json sends data as JSON from a server to a client. It helps share information in a simple, readable way.
When you want to send data from your Express server to a web page or app.
When building APIs that return data for other programs to use.
When you want to send error messages or status updates in a clear format.
When you want to share lists, objects, or any structured data easily.
When you want to respond to a client request with JSON instead of HTML.