UNPKG

558 BJavaScriptView Raw
1import filter from './filter';
2import contains from './contains';
3/**
4 * Flattens `array` a single level deep.
5 *
6 * @param {Array} arr The array to inspect.
7 * @param {Array} values The values to exclude.
8 * @return {Array} Returns the new array of filtered values.
9 * @example
10 * difference([2, 1], [2, 3]); // => [1]
11 */
12var difference = function (arr, values) {
13 if (values === void 0) { values = []; }
14 return filter(arr, function (value) { return !contains(values, value); });
15};
16export default difference;
17//# sourceMappingURL=difference.js.map
\No newline at end of file