UNPKG

930 BJavaScriptView Raw
1var _includes =
2/*#__PURE__*/
3require("./internal/_includes");
4
5var _curry2 =
6/*#__PURE__*/
7require("./internal/_curry2");
8
9var flip =
10/*#__PURE__*/
11require("./flip");
12
13var reject =
14/*#__PURE__*/
15require("./reject");
16/**
17 * Returns a new list without values in the first argument.
18 * [`R.equals`](#equals) is used to determine equality.
19 *
20 * Acts as a transducer if a transformer is given in list position.
21 *
22 * @func
23 * @memberOf R
24 * @since v0.19.0
25 * @category List
26 * @sig [a] -> [a] -> [a]
27 * @param {Array} list1 The values to be removed from `list2`.
28 * @param {Array} list2 The array to remove values from.
29 * @return {Array} The new array without values in `list1`.
30 * @see R.transduce, R.difference, R.remove
31 * @example
32 *
33 * R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]
34 */
35
36
37var without =
38/*#__PURE__*/
39_curry2(function (xs, list) {
40 return reject(flip(_includes)(xs), list);
41});
42
43module.exports = without;
\No newline at end of file