Validation API

hasObj()

Validates that the passed arguments are objects and not empty.

  • Accepts any arguments.
  • The following types do not pass validation: Array, Window, Document, HTMLCollection, Node, NodeList, Element, RegExp, Set, Map, Date, File, and FileList.
  • Returns true if all provided arguments pass the validation, otherwise, returns false.
Example:
hasObj({key: 'value'});
// true

hasObj({key: 'value'}, {key2: 'value2'});
// true

hasObj({});
// false

hasObj($('body'));
// false

hasObj({key: 'value'}, {});
// false