lib/response.js
function () {
    var data;
    if (arguments.length === 2) {
      this.status(arguments[0]);
      data = arguments[1];
    } else {
      data = arguments[0];
    }

    if (!this.get('Content-Type'))
      this.contentType('application/json');

    return this.send(data);
  }
function () {
    var data;
    if (arguments.length === 2) {
      this.status(arguments[0]);
      data = arguments[1];
    } else {
      data = arguments[0];
    }

    if (!this.get('Content-Type'))
      this.contentType('application/json');

    return this.send(data);
  }
Sends a JSON response

Examples:
res.json(null);
res.json({});
res.json(200, 'text');
res.json(404, 'woops');

@param {Mixed} body or status code
@param {Mixed} object data
@return {Response}