isFullOf()

Determines if an array, array-like object, or an object is full of items that match a specific type or tester function.

This function is valid in v2.1.0 to v2.24.3. This function has been downloaded 61 times.

Parameters

{Array|Object} arrOrObj
Array, array-like object, or object whose items will be tested.
{string|Function} tester
If a string is specified it will be assumed to be the type that all values in arrOrObj must match. Otherwise this must be a function that will accept (1) the item value, (2) the item index, and (3) a reference to arrOrObj and the return value of this function will coerced to a boolean to determine if the value matched.
{boolean=} opt_trueOnEmpty Optional, Default:false
Indicates whether or not an empty arrOrObj will allow this call to isFullOf() to evaluate to true.

Returns

{boolean}
true if all of the items in arrOrObj match tester or if arrOrObj is empty and opt_trueOnEmpty is true-ish. Otherwise false.

Required Functions

This function directly requires the following functions which are included automatically:

  • forOf()
    Traverses all the characters in a string or all of the items in an array or an object, executing a function on each one.
  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.