AdvJsArray<E> extension

on

Properties

length int
getter/setter pair

Methods

add(E element) → void
addAll(Iterable<E> iterable) → void
at(int index) → E?
The at() method is equivalent to the bracket notation when index is non-negative. For example, array0 and array.at(0) both return the first item. However, when counting elements from the end of the array, you cannot use array-1 like you may in Python or R, because all values inside the square brackets are treated literally as string properties, so you will end up reading array"-1", which is just a normal string property instead of an array index.
concat(JsArray array1, [JsArray? array2, JsArray? array3]) JsArray<E>
The concat method creates a new array. The array will first be populated by the elements in the object on which it is called. Then, for each argument, its value will be concatenated into the array — for normal objects or primitives, the argument itself will become an element of the final array; for arrays or array-like objects with the property Symbol.isConcatSpreadable set to a truthy value, each element of the argument will be independently added to the final array. The concat method does not recurse into nested array arguments.
copyWithin(int target, [int? start, int? end]) JsArray<E>
The copyWithin() method works like C and C++'s memmove, and is a high-performance method to shift the data of an Array. This especially applies to the TypedArray method of the same name. The sequence is copied and pasted as one operation; the pasted sequence will have the copied values even when the copy and paste region overlap.
entries() JsArray<JsArray>
When used on sparse arrays, the entries() method iterates empty slots as if they have the value undefined.
every(bool fn(E element, int index, JsArray<E> array)) bool
The every() method is an iterative method. It calls a provided callbackFn function once for each element in an array, until the callbackFn returns a falsy value. If such an element is found, every() immediately returns false and stops iterating through the array. Otherwise, if callbackFn returns a truthy value for all elements, every() returns true.
fill(E value, [int? start, int? end]) JsArray<E>
The fill() method is a mutating method. It does not alter the length of this, but it will change the content of this.
filter(bool fn(E element, int index, JsArray<E> array)) JsArray<E>
The filter() method is an iterative method. It calls a provided callbackFn function once for each element in an array, and constructs a new array of all the values for which callbackFn returns a truthy value. Array elements which do not pass the callbackFn test are not included in the new array.
find(bool fn(E element, int index, JsArray<E> array)) → E?
The find() method is an iterative method. It calls a provided callbackFn function once for each element in an array in ascending-index order, until callbackFn returns a truthy value. find() then returns that element and stops iterating through the array. If callbackFn never returns a truthy value, find() returns undefined.
findIndex(bool fn(E element, int index, JsArray<E> array)) int
The findIndex() is an iterative method. It calls a provided callbackFn function once for each element in an array in ascending-index order, until callbackFn returns a truthy value. findIndex() then returns the index of that element and stops iterating through the array. If callbackFn never returns a truthy value, findIndex() returns -1.
findLast(bool fn(E element, int index, JsArray<E> array)) → E?
findLastIndex(bool fn(E element, int index, JsArray<E> array)) int
flat() JsArray<E>
flatMap(dynamic fn(E element, int index, JsArray<E> array)) JsArray<E>
forEach(void fn(E element, int index, JsArray<E> array)) → void
group(dynamic fn(E element, int index, JsArray<E> array)) → dynamic
groupToMap(dynamic fn(E element, int index, JsArray<E> array)) JsMap<Object, dynamic>
includes(E element, [int? fromIndex]) bool
indexOf(E element, [int? fromIndex]) int
join([String? separator]) String
keys() JsArray
lastIndexOf(E element, [int? fromIndex]) int
map(dynamic fn(E element, int index, JsArray<E> array)) JsArray
pop() → E?
push(E element) int
reduce<T>(T fn(T accumulator, T currentValue, int currentIndex, JsArray<E> array), T initialValue) → T
reduceRight<T>(T fn(T accumulator, T currentValue, int currentIndex, JsArray<E> array), T initialValue) → T
reverse() JsArray<E>
shift() → E?
slice([int? start, int? end]) JsArray<E>
some(bool fn(E element, int index, JsArray<E> array)) bool
sort([int fn(E left, E right)?]) JsArray<E>
splice([int? start, int? deleteCount]) JsArray<E>
toLocaleString([dynamic locales, dynamic options]) JsArray<E>
unshift(E element) int
values() JsArray

Operators

operator [](int key) → E
operator []=(int key, E value) → void