UNPKG

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