code: function writeHead(context, statusCode, statusMessage, headers) {
    // 1. Status code
    statusCode |= 0; // eslint-disable-line no-param-reassign
    if (statusCode < 100 || statusCode > 999) {
      throw new RangeError(`Invalid status code: ${statusCode}`);
    }
  
    // 2. Status message
    if (typeof statusMessage === "string") {
      this.statusMessage = statusMessage;
    } else {
      this.statusMessage = statusCodes[statusCode] || "unknown";
    }
  
    // 3. Headers
    if (typeof statusMessage === "object" && typeof headers === "undefined") {
      headers = statusMessage; // eslint-disable-line no-param-reassign
    }
    if (this._headers) {
      // Slow-case: when progressive API and header fields are passed.
      if (headers) {
        const keys = Object.keys(headers);
        for (let i = 0; i < keys.length; i++) {
          const k = keys[i];
          if (k) {
            this.setHeader(k, headers[k]);
          }
        }
      }
      // only progressive api is used
      headers = this._renderHeaders(); // eslint-disable-line no-param-reassign
    }
  
    // 4. Sets everything
    context.res.status = statusCode;
    // In order to uniformize node 6 behaviour with node 8 and 10,
    // we want to never have undefined headers, but instead empty object
    context.res.headers = headers || {};
  }
docs: https://nodejs.org/api/http.html#http_response_writehead_statuscode_statusmessage_headers
  Original implementation: https://github.com/nodejs/node/blob/v6.x/lib/_http_server.js#L160
  
  @param {Object} context Azure Function context
  @param {number} statusCode
  @param {string} statusMessage
  @param {Object} headers
  @this {OutgoingMessage}