Skip to content

Commit d4443e6

Browse files
authored
Update head.js and last.js docs example (ramda#3515)
1 parent 7ee3d7a commit d4443e6

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

source/head.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ import _nth from './internal/_nth.js';
1717
* @see R.tail, R.init, R.last
1818
* @example
1919
*
20-
* R.head(['fi', 'fo', 'fum']); //=> 'fi'
21-
* R.head([]); //=> undefined
20+
* R.head([1, 2, 3]); //=> 1
21+
* R.head([1]); //=> 1
22+
* R.head([]); //=> undefined
2223
*
23-
* R.head('abc'); //=> 'a'
24-
* R.head(''); //=> undefined
24+
* R.head('abc'); //=> 'a'
25+
* R.head('a'); //=> 'a'
26+
* R.head(''); //=> undefined
2527
*/
2628
var head = _curry1(function(list) {
2729
return _nth(0, list);

source/last.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import _nth from './internal/_nth.js';
1616
* @see R.init, R.head, R.tail
1717
* @example
1818
*
19-
* R.last(['fi', 'fo', 'fum']); //=> 'fum'
20-
* R.last([]); //=> undefined
19+
* R.last([1, 2, 3]); //=> 3
20+
* R.last([1]); //=> 1
21+
* R.last([]); //=> undefined
2122
*
22-
* R.last('abc'); //=> 'c'
23-
* R.last(''); //=> undefined
23+
* R.last('abc'); //=> 'c'
24+
* R.last('a'); //=> 'a'
25+
* R.last(''); //=> undefined
2426
*/
2527
var last = _curry1(function(list) {
2628
return _nth(-1, list);

0 commit comments

Comments
 (0)