swc/crates/swc_bundler/tests/.cache/deno/ee75c362415c966a02970d3c1a67639b59e574c6.ts
2021-11-09 20:42:49 +09:00

29 lines
544 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/last.js
import nth from './nth.js';
/**
* 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;