UNPKG

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