UNPKG

507 BJavaScriptView Raw
1var nth =
2/*#__PURE__*/
3require("./nth");
4/**
5 * Returns the last element of the given list or string.
6 *
7 * @func
8 * @memberOf R
9 * @since v0.1.4
10 * @category List
11 * @sig [a] -> a | Undefined
12 * @sig String -> String
13 * @param {*} list
14 * @return {*}
15 * @see R.init, R.head, R.tail
16 * @example
17 *
18 * R.last(['fi', 'fo', 'fum']); //=> 'fum'
19 * R.last([]); //=> undefined
20 *
21 * R.last('abc'); //=> 'c'
22 * R.last(''); //=> ''
23 */
24
25
26var last =
27/*#__PURE__*/
28nth(-1);
29module.exports = last;
\No newline at end of file