数组去重

@param  {Array} arr 数组
@return {Array}     去重后的数组
511287
function uniqArr(arr) {
    let obj = {};

    arr.forEach(item => obj[item] = true);

    return Object.keys(obj);
}
291489
public static INDArrayIndex[] allFor(INDArray arr) {
        INDArrayIndex[] ret = new INDArrayIndex[arr.rank()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = NDArrayIndex.all();

        return ret;
    }
661108
public static String[] appendStrArray(String[] arr, String str) {
		String[] newArr = new String[arr.length + 1];
		System.arraycopy(arr, 0, newArr, 0, arr.length);
		newArr[arr.length] = str;
		return newArr;
	}
609741
function promiseGenerator(arr) {
  const data = [];
  const last = Symbol('last');
  
  // 添加迭代队列，以获取最后一次的promise执行结果
  arr.push(last);

  return arr.reduce((sum, value, index) => {
    return sum.then((result) => {
      // 忽略初始数据，即Promise.resolve()的返回数据
      if (index !== 0) data.push(result);

      // 如果到最后一个节点，则完成迭代，返回总体数据
      if (value === last) return data;

      return value();
    })
  }, Promise.resolve())
}
1364177
function (arr) {
        if (!_.isArray(arr)) {
            return;
        }

        var obj = {},
            key,
            val,
            i,
            ii;

        for (i = 0, ii = arr.length; i < ii; i += 2) {
            key = arr[i];
            val = arr[i + 1];

            if (_.has(obj, key)) {
                !_.isArray(obj[key]) && (obj[key] = [obj[key]]);
                obj[key].push(val);
            }
            else {
                obj[key] = val;
            }
        }

        return obj;
    }
91349
function( arr ){
                return $.map( arr, function( member ){
                    return member && member.jquery ? $.makeArray( member ) :
                        member && member.length ? drag.flatten( member ) : member;
                });
            }
1031640
function (arr) {
    var out = [], bl = sjcl.bitArray.bitLength(arr), i, tmp;
    for (i=0; i<bl/8; i++) {
      if ((i&3) === 0) {
        tmp = arr[i/4];
      }
      out.push(tmp >>> 24);
      tmp <<= 8;
    }
    return out;
  }
805949
function arrayToList ( arr ) {
	const length = arr.length;
	const data = new types.List(length);
	for ( let i = 0; i < length; i++ ) {
		data.setValue(i, setJsonValueToSassValue(arr[i]));
	}
	return data;
}
1043988
function filter(arr, cb, thisArg) {
  cb = makeIterator(cb, thisArg);
  if (arr == null) {
    return [];
  }
  var len = arr.length;
  var res = [];
  for (var i = 0; i < len; i++) {
    var ele = arr[i];

    if (cb(ele, i, arr)) {
      res.push(ele);
    }
  }
  return res;
}
737778
function (arr) {
        this.array[0] = arr[0];
        this.array[1] = arr[1];
        this.array[2] = arr[2];
        this.array[3] = arr[3];

        this._dirty = true;
        return this;
    }
1072772
function(arr) {
      var n = [], l=arr.length,i;
      for(i = 0 ; i < l ; i++) {
         if( !lang.isNull(arr[i]) && !lang.isUndefined(arr[i]) ) {
            n.push(arr[i]);
         }
      }
      return n;
   }
814332
function arrToString(arr) {
    if (arr.length === 0) return '';
    var str = '(' + Z.toString(arr[0]);
    for (var idx = 1; idx < arr.length; idx += 1) {
      str = str + ', ' + Z.toString(arr[idx]);
    }
    return str + ')';
  }
1073832
function needRecurseArray(arr) {
  for (var i = 0; i < arr.length; i++) {
    var el = arr[i]
    if (typeof el !== 'number' && typeof el !== 'string' && el != null) return true
  }
  return false
}
544460
function ensureAnArray (arr) {
        if (Object.prototype.toString.call(arr) === '[object Array]') {
            return arr;
        } else if (arr === null || arr === void 0) {
            return [];
        } else {
            return [arr];
        }
    }
392731
function arrayToBuffer(arr) {
    if (arr instanceof ArrayBuffer) {
        return arr;
    }
    var ab = arr.buffer;
    if (arr.byteOffset === 0 && arr.byteLength === ab.byteLength) {
        return ab;
    }
    return arr.buffer.slice(arr.byteOffset, arr.byteOffset + arr.byteLength);
}
723638
function parse(str, arr) {
  return str.replace(/\.\w+|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g, function(expr) {
    if(forbidden.indexOf(expr[0]) > -1) return expr;
    if(!~arr.indexOf(expr)) arr.push(expr);
    return 'model.' + expr;
  });
}
1042366
function parseDisabledArr(arr) {
  let min;
  let max;
  let arrNew = cloneDeep(arr);
  arrNew = arrNew.map((item) => {
    const { start, end } = item;
    if (!start && !end) {
      const dateTime = new Date(item).getTime();
      if (dateTime) {
        return {
          start: dateTime,
          end: dateTime,
        };
      }
      return false;
    }
    return {
      start: new Date(start).getTime(),
      end: new Date(end).getTime(),
    };
  });
  let newArr = arrNew.filter(item => !!item);
  // 求时间并集并求出 最大值和最小值
  newArr = newArr.filter((item) => {
    const { start, end } = item;
    if (start && !end) { // 求max
      if (!max) {
        max = start;
      } else {
        max = max > start ? start : max;
      }
      return false;
    }
    if (!start && end) {
      if (!min) {
        min = end;
      } else {
        min = min < end ? end : min;
      }
      return false;
    }
    if (end && start) {
      if (start > end) {
        warn('Datetime: Please check your disabledDate props returns');
        return false;
      }
      if (min && min >= start) {
        min = min < end ? end : min;
        return false;
      }
      if (max && max <= end) {
        max = max > start ? start : max;
        return false;
      }
      return true;
    }
    return true;
  });
  let startEnd = [];
  // 时间排序
  startEnd = newArr.sort((a, b) => a.start - b.start);
  return {
    maxTime: max,
    minTime: min,
    startEnd,
  };
}