Namespace: Basic:hasMembers

Basic:hasMembers

Source:

Methods

hasMembers(obj, memberNames, verboseopt) → {Boolean}

"Validates" an object in a very basic way by checking if all given members are present and are not nullish.

Parameters:
Name Type Attributes Default Description
obj Object

the object to check

memberNames Array.<String>

the names of the members to check

verbose Boolean <optional>
false

defines if method should output missing members to console

Source:
Returns:
all memberNames present and not nullish
Type
Boolean
Example
function pat(kitten){
  if( hasMembers(kitten, ['fluff', 'meow', 'scratch']) ){
    ...
  }
}