Is object Error type - Node.js Object

Node.js examples for Object:Object Type

Description

Is object Error type

Demo Code

function isError(e) {
  return isObject(e) &&
      (objectToString(e) === '[object Error]' || e instanceof Error);
}

function isObject(arg) {
  return typeof arg === 'object' && arg !== null;
}

Related Tutorials