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:
634 bytes
|
Line | |
---|
1 | import slice from "./slice.js";
|
---|
2 | /**
|
---|
3 | * Returns all but the last element of the given list or string.
|
---|
4 | *
|
---|
5 | * @func
|
---|
6 | * @memberOf R
|
---|
7 | * @since v0.9.0
|
---|
8 | * @category List
|
---|
9 | * @sig [a] -> [a]
|
---|
10 | * @sig String -> String
|
---|
11 | * @param {*} list
|
---|
12 | * @return {*}
|
---|
13 | * @see R.last, R.head, R.tail
|
---|
14 | * @example
|
---|
15 | *
|
---|
16 | * R.init([1, 2, 3]); //=> [1, 2]
|
---|
17 | * R.init([1, 2]); //=> [1]
|
---|
18 | * R.init([1]); //=> []
|
---|
19 | * R.init([]); //=> []
|
---|
20 | *
|
---|
21 | * R.init('abc'); //=> 'ab'
|
---|
22 | * R.init('ab'); //=> 'a'
|
---|
23 | * R.init('a'); //=> ''
|
---|
24 | * R.init(''); //=> ''
|
---|
25 | */
|
---|
26 |
|
---|
27 | var init =
|
---|
28 | /*#__PURE__*/
|
---|
29 | slice(0, -1);
|
---|
30 | export default init; |
---|
Note:
See
TracBrowser
for help on using the repository browser.