- List
- Example usage
- Example in the readme
- Example now use index instead of the name to remove
- Sorting(use the internal array
[].sort()
) - Map
- Typescript Typings
forEach
andfilter
.
empty()
.
map()
no longer call[].map()
in the code
containAll(list)
=> Check if a list is contained in this one.set(index, value)
=> Set the value at that index.indexOf(value)
=> Returns the index of the first occurrence of a value in a list, or -1 if it is not present.shuffle()
=> Shuffle the list using a Fisher–Yates shuffle algorithm.
- deprecated
empty
and renamed it toisEmpty
copy()
=> Create a copy of the list.join(seperator)
=> Adds all the elements of an list into a string, separated by the specified separator string.shift()
=> Remove the first element in the list.slice(start?, end?)
=> Returns a copy of a section of an list.reverse()
=> Reverses the elements in an list. Ex : a list of letterA, B, C
would become list ofC, B, A
- Fixed a crash in the map.
- Fixed a bug where
forEach
was using(index, value, list)
for the predicate instead of(value, index, list)
8
toArray()
=> return the internal array.equals(otherList)
=> check if both list have the same internal. (they don't have to be the same object)retainAll(otherList)
=> Retains only the elements in this list that are contained in the other List.fromList(otherList)
(non static) => add all elements from another list to this oneaddIf(otherList, predicate)
=> add another list content to this one if it match the predicate
- Fixed
static fromList()
not working properly
clear()
=> same asremoveAll()
fromArray(array)
(non static) => same as the staticfromArray(array)
method.removeALLBut(predicate)
=> remove all elements that do not match the predicate
- Fixed issues with the typings
static merge(lists)
=> merge the lists into one.
- typing for static methods is better now.
fill(index1, index2, value)
=> fill every field between the two indexes by the provided value, return the modified listclone()
=> alias forcopy()
static from(...elements)
=> create a list from those elements
- fixed typings for forEach
ImmutableList
is a non modifiable list.ImmutableList.merge(list)
to merge multiple immutable lists into one.replace(i, value)
=> alias for set
- fixed a few errors with the List
- fixed a typo in
List.fromJson();
- more tests
- fixed a few methods
getRandomElement()
return a random element from the list