source: node_modules/ramda/es/head.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: 553 bytes
RevLine 
[d24f17c]1import nth from "./nth.js";
2/**
3 * Returns the first element of the given list or string. In some libraries
4 * this function is named `first`.
5 *
6 * @func
7 * @memberOf R
8 * @since v0.1.0
9 * @category List
10 * @sig [a] -> a | Undefined
11 * @sig String -> String
12 * @param {Array|String} list
13 * @return {*}
14 * @see R.tail, R.init, R.last
15 * @example
16 *
17 * R.head(['fi', 'fo', 'fum']); //=> 'fi'
18 * R.head([]); //=> undefined
19 *
20 * R.head('abc'); //=> 'a'
21 * R.head(''); //=> ''
22 */
23
24var head =
25/*#__PURE__*/
26nth(0);
27export default head;
Note: See TracBrowser for help on using the repository browser.