UNPKG

ut2

Version:

一个现代 JavaScript 实用工具库。[点击查看在线文档]。

15 lines (11 loc) 411 B
'use strict'; var isArray = require('./isArray.js'); var uniq = require('./uniq.js'); function union(array, other, iteratee, strickCheck) { if (other === void 0) { other = []; } if (strickCheck === void 0) { strickCheck = false; } array = isArray(array) ? array : []; other = isArray(other) ? other : []; return uniq(array.concat(other), iteratee, strickCheck); } module.exports = union;