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:
921 bytes
|
Line | |
---|
1 | import _checkForMethod from "./internal/_checkForMethod.js";
|
---|
2 | import _curry1 from "./internal/_curry1.js";
|
---|
3 | import slice from "./slice.js";
|
---|
4 | /**
|
---|
5 | * Returns all but the first element of the given list or string (or object
|
---|
6 | * with a `tail` method).
|
---|
7 | *
|
---|
8 | * Dispatches to the `slice` method of the first argument, if present.
|
---|
9 | *
|
---|
10 | * @func
|
---|
11 | * @memberOf R
|
---|
12 | * @since v0.1.0
|
---|
13 | * @category List
|
---|
14 | * @sig [a] -> [a]
|
---|
15 | * @sig String -> String
|
---|
16 | * @param {*} list
|
---|
17 | * @return {*}
|
---|
18 | * @see R.head, R.init, R.last
|
---|
19 | * @example
|
---|
20 | *
|
---|
21 | * R.tail([1, 2, 3]); //=> [2, 3]
|
---|
22 | * R.tail([1, 2]); //=> [2]
|
---|
23 | * R.tail([1]); //=> []
|
---|
24 | * R.tail([]); //=> []
|
---|
25 | *
|
---|
26 | * R.tail('abc'); //=> 'bc'
|
---|
27 | * R.tail('ab'); //=> 'b'
|
---|
28 | * R.tail('a'); //=> ''
|
---|
29 | * R.tail(''); //=> ''
|
---|
30 | */
|
---|
31 |
|
---|
32 | var tail =
|
---|
33 | /*#__PURE__*/
|
---|
34 | _curry1(
|
---|
35 | /*#__PURE__*/
|
---|
36 | _checkForMethod('tail',
|
---|
37 | /*#__PURE__*/
|
---|
38 | slice(1, Infinity)));
|
---|
39 |
|
---|
40 | export default tail; |
---|
Note:
See
TracBrowser
for help on using the repository browser.