function insertOrUpdateBy(array, predicate, object, insertAtFront) {
  if(_.isArray(array)) {
    if(!updateBy(array, predicate, object, insertAtFront)) {
      array.push(object);
    }
  } else {
    return [object];
  }

  return array;
}
Inserts or updates an element in an array by a given predicate.

@static
@memberOf _
@category Array
@param {Array} array The array to search.
@param {Array|Function|Object|string} [predicate=_.identity] The function invoked per iteration.
@param {*} object The data.
@param {boolean} [insertAtFront=false] Insert new elements at the front of the array.
@returns {Array} Returns the array.