Skip to main content
Module

x/ramda/last.js

:ram: Practical functional Javascript
Very Popular
Go to Latest
File
import nth from './nth';

/** * Returns the last element of the given list or string. * * @func * @memberOf R * @since v0.1.4 * @category List * @sig [a] -> a | Undefined * @sig String -> String * @param {*} list * @return {*} * @see R.init, R.head, R.tail * @example * * R.last(['fi', 'fo', 'fum']); //=> 'fum' * R.last([]); //=> undefined * * R.last('abc'); //=> 'c' * R.last(''); //=> '' */var last = nth(-1);export default last;