function merge(left, right){
    var result  = [],
        il      = 0,
        ir      = 0;

    while (il < left.length && ir < right.length){
        if (left[il] < right[ir]){
            result.push(left[il++]);
        } else {
            result.push(right[ir++]);
        }
    }

    return result.concat(left.slice(il)).concat(right.slice(ir));
}
Merges two arrays in order based on their natural
relationship.
@param {Array} left The first array to merge.
@param {Array} right The second array to merge.
@return {Array} The merged array.