whileExists()

Creates a copy of an array with all of the consecutive items up to but not including the first value false-ish value.

This function is valid in v2.2.0 to v2.12.0. This function has been downloaded 10 times.

Parameters

{Array} array
Array or array-like object containing values that will be copied.
{boolean=} opt_fromEnd Optional, Default:false
Indicates that the values should be copied starting from the end, not from the beginning as normal.

Returns

{Array}
If opt_fromEnd is not given or is false-ish, an array of all of the consecutive true-ish values starting at the beginning of array will be returned. Otherwise an array of all of the consecutive true-ish values starting at the end of array will be returned.

Required Function

This function requires the following function which is included automatically:

  • untilExists()
    Creates a copy of an array with all of the consecutive items up to but not including the first value true-ish value.