isObject.js 174 B

1234567
  1. // Is a given variable an object?
  2. function isObject(obj) {
  3. var type = typeof obj;
  4. return type === 'function' || type === 'object' && !!obj;
  5. }
  6. module.exports = isObject;