source: node_modules/ramda/es/append.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 877 bytes
RevLine 
[d24f17c]1import _concat from "./internal/_concat.js";
2import _curry2 from "./internal/_curry2.js";
3/**
4 * Returns a new list containing the contents of the given list, followed by
5 * the given element.
6 *
7 * @func
8 * @memberOf R
9 * @since v0.1.0
10 * @category List
11 * @sig a -> [a] -> [a]
12 * @param {*} el The element to add to the end of the new list.
13 * @param {Array} list The list of elements to add a new item to.
14 * list.
15 * @return {Array} A new list containing the elements of the old list followed by `el`.
16 * @see R.prepend
17 * @example
18 *
19 * R.append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']
20 * R.append('tests', []); //=> ['tests']
21 * R.append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]
22 */
23
24var append =
25/*#__PURE__*/
26_curry2(function append(el, list) {
27 return _concat(list, [el]);
28});
29
30export default append;
Note: See TracBrowser for help on using the repository browser.