main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
490 bytes
|
Line | |
---|
1 | import nth from "./nth.js";
|
---|
2 | /**
|
---|
3 | * Returns the last element of the given list or string.
|
---|
4 | *
|
---|
5 | * @func
|
---|
6 | * @memberOf R
|
---|
7 | * @since v0.1.4
|
---|
8 | * @category List
|
---|
9 | * @sig [a] -> a | Undefined
|
---|
10 | * @sig String -> String
|
---|
11 | * @param {*} list
|
---|
12 | * @return {*}
|
---|
13 | * @see R.init, R.head, R.tail
|
---|
14 | * @example
|
---|
15 | *
|
---|
16 | * R.last(['fi', 'fo', 'fum']); //=> 'fum'
|
---|
17 | * R.last([]); //=> undefined
|
---|
18 | *
|
---|
19 | * R.last('abc'); //=> 'c'
|
---|
20 | * R.last(''); //=> ''
|
---|
21 | */
|
---|
22 |
|
---|
23 | var last =
|
---|
24 | /*#__PURE__*/
|
---|
25 | nth(-1);
|
---|
26 | export default last; |
---|
Note:
See
TracBrowser
for help on using the repository browser.