List¶
Represents a list of values.
\[[expr1, expr2, ..., exprN]\]
[]
[1, 2, 3]
Properties¶
push
¶
Adds value
to the list.
(value: Any) => Null
pushAll
¶
Adds all values of values
to the list.
(values: List<Any>) => Null
pop
¶
Removes the last element.
() => Null
clear
¶
Removes all the elements.
() => Null
length
¶
Returns length of the list.
() => Number
isEmpty
¶
Is the list empty?
() => Boolean
isNotEmpty
¶
Is the list not empty?
() => Boolean
clone
¶
Returns clone of the list.
() => List<Any>
reversed
¶
Returns reversed clone of the list.
() => List<Any>
contains
¶
Check if element
is present in the list.
(element: Any) => Boolean
indexOf
¶
Returns the index of element
in the list.
(element: Any) => Boolean
lastIndexOf
¶
Returns the last index of element
in the list.
(element: Any) => Boolean
remove
¶
Removes all element
from the list.
(element: Any) => Boolean
sublist
¶
Returns a sub-list consisting elements between start
and end
.
(start: Number, end: Number) => List<Any>
find
¶
Returns the matched element using the predicate
.
(predicate: (element: Any) => Boolean) => Any
findIndex
¶
Returns the index of matched element using the predicate
.
(predicate: (element: Any) => Boolean) => Number
findLastIndex
¶
Returns the last index of matched element using the predicate
.
(predicate: (element: Any) => Boolean) => Number
map
¶
Returns the list of mapped values using predicate
.
(predicate: (element: Any) => Any) => List<Any>
filter
¶
Returns the list of filtered values using predicate
.
(predicate: (element: Any) => Boolean) => List<Any>
sort
¶
Returns the sorted list of using sortBy
.
(sortBy: (a: Any, b: Any) => Number) => List<Any>
flat
¶
Returns the flatted list of level level
.
(level: Number) => List<Any>
flatDeep
¶
Returns the flatted list of level this.length
.
() => List<Any>
unique
¶
Returns the list of unique elements.
() => List<Any>
forEach
¶
Iterates the list using predicate
.
(predicate: (element: Any) => Null) => Null
join
¶
Returns the elements converted to string, joined by delimiter
.
(delimiter: String) => String