source: node_modules/ramda/es/prepend.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: 688 bytes
Line 
1import _concat from "./internal/_concat.js";
2import _curry2 from "./internal/_curry2.js";
3/**
4 * Returns a new list with the given element at the front, followed by the
5 * contents of the list.
6 *
7 * @func
8 * @memberOf R
9 * @since v0.1.0
10 * @category List
11 * @sig a -> [a] -> [a]
12 * @param {*} el The item to add to the head of the output list.
13 * @param {Array} list The array to add to the tail of the output list.
14 * @return {Array} A new array.
15 * @see R.append
16 * @example
17 *
18 * R.prepend('fee', ['fi', 'fo', 'fum']); //=> ['fee', 'fi', 'fo', 'fum']
19 */
20
21var prepend =
22/*#__PURE__*/
23_curry2(function prepend(el, list) {
24 return _concat([el], list);
25});
26
27export default prepend;
Note: See TracBrowser for help on using the repository browser.