@@ -59,39 +59,7 @@ import push from 'immutable-arrays/src/immutable-push';
5959
6060## API
6161
62- <dl >
63- <dt ><a href =" #immutableArrays.push " >immutableArrays.push(array, ...elementN)</a > ⇒ <code >Array</code ></dt >
64- <dd ><p >Adds one or more elements to the end of an array by returning a new array instead of mutating the original one.</p ></dd >
65-
66- <dt ><a href =" #immutableArrays.pop " >immutableArrays.pop(array)</a > ⇒ <code >Array</code ></dt >
67- <dd ><p >Removes the last element from an array by returning a new array instead of mutating the original one.</p ></dd >
68-
69- <dt ><a href =" #immutableArrays.shift " >immutableArrays.shift(array)</a > ⇒ <code >Array</code ></dt >
70- <dd ><p >Removes the first element from an array.</p ></dd >
71-
72- <dt ><a href =" #immutableArrays.unshift " >immutableArrays.unshift(array, ...elementN)</a > ⇒ <code >Array</code ></dt >
73- <dd ><p >Adds one or more elements to the beginning of an array.</p ></dd >
74-
75- <dt ><a href =" #immutableArrays.reverse " >immutableArrays.reverse(array)</a > ⇒ <code >Array</code ></dt >
76- <dd ><p >Reverses an array (not in place). The first array element becomes the last, and the last array element becomes the first.</p ></dd >
77-
78- <dt ><a href =" #immutableArrays.sort " >immutableArrays.sort(array, [compareFunction])</a > ⇒ <code >Array</code ></dt >
79- <dd ><p >Sorts the elements of an array (not in place) and returns a sorted array.</p ></dd >
80-
81- <dt ><a href =" #immutableArrays.splice " >immutableArrays.splice(array, [start], [deleteCount], [...elementN])</a > ⇒ <code >Array</code ></dt >
82- <dd ><p >Removes existing elements and/or adds new elements to an array.</p ></dd >
83- </dl >
84-
85- #### Bonus method
86-
87- <dl >
88- <dt ><a href =" #immutableArrays.del " >immutableArrays.del(array, index)</a > ⇒ <code >Array</code ></dt >
89- <dd ><p >Deletes an element from an array by its index in the array.</p ></dd >
90- </dl >
91-
92- <a id =" immutableArrays.push " name =" immutableArrays.push " ></a >
93-
94- ## immutableArrays.push(array, ...elementN) ⇒ <code >Array</code >
62+ ### immutableArrays.push(array, ...elementN) ⇒ <code >Array</code >
9563Adds one or more elements to the end of an array by returning
9664a new array instead of mutating the original one.
9765
@@ -110,9 +78,7 @@ const resultArray = immutableArrays.push(originalArray, 'f', 'g');
11078// -> resultArray ['a', 'b', 'c', 'd', 'e', 'f', 'g']
11179```
11280
113- <a id =" immutableArrays.pop " name =" immutableArrays.pop " ></a >
114-
115- ## immutableArrays.pop(array) ⇒ <code >Array</code >
81+ ### immutableArrays.pop(array) ⇒ <code >Array</code >
11682Removes the last element from an array by returning
11783a new array instead of mutating the original one.
11884
@@ -130,9 +96,7 @@ const resultArray = immutableArrays.pop(originalArray);
13096// -> resultArray ['a', 'b', 'c', 'd']
13197```
13298
133- <a id =" immutableArrays.shift " name =" immutableArrays.shift " ></a >
134-
135- ## immutableArrays.shift(array) ⇒ <code >Array</code >
99+ ### immutableArrays.shift(array) ⇒ <code >Array</code >
136100Removes the first element from an array.
137101
138102** Returns** : <code >Array</code > - A new array with the first element removed.
@@ -149,9 +113,7 @@ const resultArray = immutableArrays.shift(originalArray);
149113// -> resultArray ['b', 'c', 'd', 'e']
150114```
151115
152- <a id =" immutableArrays.unshift " name =" immutableArrays.unshift " ></a >
153-
154- ## immutableArrays.unshift(array, ...elementN) ⇒ <code >Array</code >
116+ ### immutableArrays.unshift(array, ...elementN) ⇒ <code >Array</code >
155117Adds one or more elements to the beginning of an array.
156118
157119** Returns** : <code >Array</code > - A new array with the new elements added to the front.
@@ -169,9 +131,7 @@ const resultArray = immutableArrays.unshift(originalArray, 'f', 'g');
169131// -> resultArray ['f', 'g', 'a', 'b', 'c', 'd', 'e']
170132```
171133
172- <a id =" immutableArrays.reverse " name =" immutableArrays.reverse " ></a >
173-
174- ## immutableArrays.reverse(array) ⇒ <code >Array</code >
134+ ### immutableArrays.reverse(array) ⇒ <code >Array</code >
175135Reverses an array (not in place).
176136The first array element becomes the last, and the last array element becomes the first.
177137
@@ -189,9 +149,7 @@ const resultArray = immutableArrays.reverse(originalArray);
189149// -> resultArray ['e', 'd', 'c', 'b', 'a']
190150```
191151
192- <a id =" immutableArrays.sort " name =" immutableArrays.sort " ></a >
193-
194- ## immutableArrays.sort(array, [ compareFunction] ) ⇒ <code >Array</code >
152+ ### immutableArrays.sort(array, [ compareFunction] ) ⇒ <code >Array</code >
195153Sorts the elements of an array (not in place) and returns a sorted array.
196154
197155** Returns** : <code >Array</code > - A new sorted array.
@@ -223,9 +181,7 @@ const resultArray = immutableArrays.sort(stringArray, (a, b) => a.toLowerCase()
223181// -> resultArray ['Humpback', 'Blue', 'Beluga']
224182```
225183
226- <a id =" immutableArrays.splice " name =" immutableArrays.splice " ></a >
227-
228- ## immutableArrays.splice(array, [ start] , [ deleteCount] , [ ...elementN] ) ⇒ <code >Array</code >
184+ ### immutableArrays.splice(array, [ start] , [ deleteCount] , [ ...elementN] ) ⇒ <code >Array</code >
229185Removes existing elements and/or adds new elements to an array.
230186
231187** Returns** : <code >Array</code > - The result array.
@@ -285,9 +241,7 @@ const resultArray = immutableArrays.splice(originalArray, originalArray.length -
285241// -> resultArray ['a', 'b', 'c', 'lorem', 'ipsum']
286242```
287243
288- <a id =" immutableArrays.del " name =" immutableArrays.del " ></a >
289-
290- ## immutableArrays.del(array, index) ⇒ <code >Array</code >
244+ ### immutableArrays.del(array, index) ⇒ <code >Array</code >
291245Deletes an element from an array by its index in the array.
292246
293247** Returns** : <code >Array</code > - A new array with the element removed.
0 commit comments