Take an array and slice it in halves, sorting each half along the way.

@param  {array} items
@return {array} the sorted array
429535
function (items) {
    if (items.length < 2) {
        return items;
    }

    var middle = Math.floor(items.length / 2);

    return merge(
        mergeSort(items.slice(0, middle)),
        mergeSort(items.slice(middle))
    );
}
871034
function slice(args, begin, end) {
  return Array.prototype.slice.call(args, begin, end);
}
1049463
function (items) {
                var
                    idx;
                idx = items.length;
                while (idx--) {
                    if (0 !== items[idx].min()) {
                        ++idx;
                        break;
                    }
                }
                return idx;
            }
105208
public static <T> T[] slice(T[] array, int... indexes) {
		int length = indexes.length;
		T[] slice = ObjectArrays.newArray(array, length);
		for (int i = 0; i < length; i++) {
			slice[i] = array[indexes[i]];
		}
		return slice;
	}
1214564
function formatItems(items) {
    if (items.length <= 2) {
        return items.join(" and ")
    }
    return `all of ${items.slice(0, -1).join(", ")} and ${
        items[items.length - 1]
    }`
}
1279828
function(items) {
            if(!items) return;
            if(!this.settings.items) this.settings.items = [];
            if(!$.isArray(items)) items = [items];
            this.settings.items = this.settings.items.concat(items);

            this.destroy();
            this.init();
        }
87812
function slice(what, start) {
        for (var j = 0, i = start || 0, arr = []; i < what.length; i++) {
            arr[j++] = what[i];
        }
        return arr;
    }
844009
def slice(self, items):
        ''''''
        if self.limit:
            if self.page>self.pages_count:
                return []
            if self.page == self.pages_count:
                return items[self.limit*(self.page-1):]
            return items[self.limit*(self.page-1):self.limit*self.page]
        else:
            return items[:]
1125661
function iteratorFor(items) {
    var iterator = {
      next: function next() {
        var value = items.shift();
        return { done: value === undefined, value: value };
      }
    };

    if (support.iterable) {
      iterator[Symbol.iterator] = function () {
        return iterator;
      };
    }

    return iterator;
  }
664615
function convertItems(items)
                        {
                            if (!items || items.length <= 0)
                                return;

                            items.forEach(function (item) {
                                getPageIndex(item).then(
                                        function (pageIndex) {
                                            if (pageIndex != null)
                                                item.pageIndex = pageIndex;
                                            else
                                                delete item.pageIndex;
                                        },
                                        function (error) {
                                            log.error(
                                                    "cannot determine page index for outline item",
                                                    item, error);
                                            delete item.pageIndex;
                                        }
                                );
                                convertItems(item.items);
                            });
                        }
1231175
function normalizeItems(items, params) {
        var _items = [];
        for (var i = 0, l = items.length; i < l; i++) {
            _items.push({
                id: items[i],
                params: params
            });
        }

        return _items;
    }
963551
function (array) {
    var m = array.length, t, i;

    // While there remain elements to shuffle…
    while (m) {

      // Pick a remaining element…
      i = Math.floor(Math.random() * m--);

      // And swap it with the current element.
      t = array[m];
      array[m] = array[i];
      array[i] = t;
    }

    return array;
  }
725454
function unique(array) {
    array.sort();

    var i, item, lastItem;

    for (i = array.length - 1; i >= 0; i--) {
        item = array[i];
        if (item == lastItem) {
            array.splice(i, 1);
        } else {
            lastItem = item;
        }
    }

    return array;
}
1276820
function removeAt(items, index) {
  var copy = items.slice();
  copy.splice(index, 1);
  return copy;
}
701201
function slice(v, start, end, step) {
  var r = [];
  var i = void 0;
  if (step > 0) {
    for (i = start; i < end; i += step) {
      r.push(v[i]);
    }
  } else {
    for (i = start; i > end; i += step) {
      r.push(v[i]);
    }
  }
  return r;
}
727711
function (target, array) {
    var start = 0
    var length = array.length
    while (length > 0) {
      var half = length >> 1
      var middle = start + half
      if (array[middle] <= target) {
        length = length - 1 - half
        start = middle + 1
      } else {
        length = half
      }
    }
    return start - 1
  }
189906
function (item) {
        item.value.sort(function (a, b) {
            if (a.key < b.key) {
                return -1;
            }
            /* istanbul ignore next */
            // Below line exists only for the sake of completeness. Generally the array will
            // always be sorted, and therefore it is impossible to get to this state in a test.
            return a.key > b.key ? 1 : 0;
        });
        return item;
    }