source: node_modules/ramda/es/remove.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: 958 bytes
Line 
1import _curry3 from "./internal/_curry3.js";
2/**
3 * Removes the sub-list of `list` starting at index `start` and containing
4 * `count` elements. _Note that this is not destructive_: it returns a copy of
5 * the list with the changes.
6 * <small>No lists have been harmed in the application of this function.</small>
7 *
8 * @func
9 * @memberOf R
10 * @since v0.2.2
11 * @category List
12 * @sig Number -> Number -> [a] -> [a]
13 * @param {Number} start The position to start removing elements
14 * @param {Number} count The number of elements to remove
15 * @param {Array} list The list to remove from
16 * @return {Array} A new Array with `count` elements from `start` removed.
17 * @see R.without
18 * @example
19 *
20 * R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]
21 */
22
23var remove =
24/*#__PURE__*/
25_curry3(function remove(start, count, list) {
26 var result = Array.prototype.slice.call(list, 0);
27 result.splice(start, count);
28 return result;
29});
30
31export default remove;
Note: See TracBrowser for help on using the repository browser.