ES6 Classes & Constructors

What is the purpose of Error.captureStackTrace in this code?
class HttpError extends Error {
  constructor(message, statusCode) {
    super(message);
    this.statusCode = statusCode;
    this.name = this.constructor.name;
    Error.captureStackTrace(this, this.constructor);
  }
}
Next Question (26/28)