source: node_modules/ramda/src/last.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: 510 bytes
RevLine 
[d24f17c]1var nth =
2/*#__PURE__*/
3require("./nth.js");
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;
Note: See TracBrowser for help on using the repository browser.