UNPKG

720 BJavaScriptView Raw
1var _concat =
2/*#__PURE__*/
3require("./internal/_concat");
4
5var _curry2 =
6/*#__PURE__*/
7require("./internal/_curry2");
8/**
9 * Returns a new list with the given element at the front, followed by the
10 * contents of the list.
11 *
12 * @func
13 * @memberOf R
14 * @since v0.1.0
15 * @category List
16 * @sig a -> [a] -> [a]
17 * @param {*} el The item to add to the head of the output list.
18 * @param {Array} list The array to add to the tail of the output list.
19 * @return {Array} A new array.
20 * @see R.append
21 * @example
22 *
23 * R.prepend('fee', ['fi', 'fo', 'fum']); //=> ['fee', 'fi', 'fo', 'fum']
24 */
25
26
27var prepend =
28/*#__PURE__*/
29_curry2(function prepend(el, list) {
30 return _concat([el], list);
31});
32
33module.exports = prepend;
\No newline at end of file