index.js
/**
 * An expression for invoking action when the given array is not null & not empty.
 * @param {function} action - the action to perform
 * @param {function} actionWhatIfNot - the action to perform when the array is null or empty.s
 */
An expression for invoking action when the given array is not null & not empty.
@param {function} action - the action to perform
@param {function} actionWhatIfNot - the action to perform when the array is null or empty.s
An expression for invoking action when the given array is not null & not empty . @param { function } action - the action to perform @param { function } actionWhatIfNot - the action to perform when the array is null or empty . s
function whatIfNotNullOrEmpty(action, actionWhatIfNot) {
  if (!Array.isArray(this)) return this;
  let given = this;
  return whatIfNot.call(
    this,
    given !== null && given.length > 0,
    action,
    actionWhatIfNot
  );
}
function whatIfNotNullOrEmpty ( action , actionWhatIfNot ) { if ( ! Array . isArray ( this ) ) return this ; let given = this ; return whatIfNot . call ( this , given !== null && given . length > 0 , action , actionWhatIfNot ) ; }
An expression for invoking action when the given array is not null & not empty.
An expression for invoking action when the given array is not null & not empty .