function isObject(x) {
    return x && typeof(x) === 'object' && !isArray(x);
  }
Checks type of a value. This method will also accept null and array
as valid types. It will not treat null or arrays as objects. Multiple
types can be passed into this method and it will be true if any matches
are found.