AdvJsArray<E> extension

on

Properties

length int

Available on JsArray<E>, provided by the AdvJsArray extension

getter/setter pair

Methods

add(E element) → void

Available on JsArray<E>, provided by the AdvJsArray extension

addAll(Iterable<E> iterable) → void

Available on JsArray<E>, provided by the AdvJsArray extension

at(int index) → E?

Available on JsArray<E>, provided by the AdvJsArray extension

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>

Available on JsArray<E>, provided by the AdvJsArray extension

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>

Available on JsArray<E>, provided by the AdvJsArray extension

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>

Available on JsArray<E>, provided by the AdvJsArray extension

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

Available on JsArray<E>, provided by the AdvJsArray extension

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>

Available on JsArray<E>, provided by the AdvJsArray extension

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>

Available on JsArray<E>, provided by the AdvJsArray extension

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?

Available on JsArray<E>, provided by the AdvJsArray extension

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

Available on JsArray<E>, provided by the AdvJsArray extension

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?

Available on JsArray<E>, provided by the AdvJsArray extension

findLastIndex(bool fn(E element, int index, JsArray<E> array)) int

Available on JsArray<E>, provided by the AdvJsArray extension

flat() JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

flatMap(dynamic fn(E element, int index, JsArray<E> array)) JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

forEach(void fn(E element, int index, JsArray<E> array)) → void

Available on JsArray<E>, provided by the AdvJsArray extension

group(dynamic fn(E element, int index, JsArray<E> array)) → dynamic

Available on JsArray<E>, provided by the AdvJsArray extension

groupToMap(dynamic fn(E element, int index, JsArray<E> array)) JsMap<Object, dynamic>

Available on JsArray<E>, provided by the AdvJsArray extension

includes(E element, [int? fromIndex]) bool

Available on JsArray<E>, provided by the AdvJsArray extension

indexOf(E element, [int? fromIndex]) int

Available on JsArray<E>, provided by the AdvJsArray extension

join([String? separator]) String

Available on JsArray<E>, provided by the AdvJsArray extension

keys() JsArray

Available on JsArray<E>, provided by the AdvJsArray extension

lastIndexOf(E element, [int? fromIndex]) int

Available on JsArray<E>, provided by the AdvJsArray extension

map(dynamic fn(E element, int index, JsArray<E> array)) JsArray

Available on JsArray<E>, provided by the AdvJsArray extension

pop() → E?

Available on JsArray<E>, provided by the AdvJsArray extension

push(E element) int

Available on JsArray<E>, provided by the AdvJsArray extension

reduce<T>(T fn(T accumulator, T currentValue, int currentIndex, JsArray<E> array), T initialValue) → T

Available on JsArray<E>, provided by the AdvJsArray extension

reduceRight<T>(T fn(T accumulator, T currentValue, int currentIndex, JsArray<E> array), T initialValue) → T

Available on JsArray<E>, provided by the AdvJsArray extension

reverse() JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

shift() → E?

Available on JsArray<E>, provided by the AdvJsArray extension

slice([int? start, int? end]) JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

some(bool fn(E element, int index, JsArray<E> array)) bool

Available on JsArray<E>, provided by the AdvJsArray extension

sort([int fn(E left, E right)?]) JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

splice([int? start, int? deleteCount]) JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

toLocaleString([dynamic locales, dynamic options]) JsArray<E>

Available on JsArray<E>, provided by the AdvJsArray extension

unshift(E element) int

Available on JsArray<E>, provided by the AdvJsArray extension

values() JsArray

Available on JsArray<E>, provided by the AdvJsArray extension

Operators

operator [](int key) → E

Available on JsArray<E>, provided by the AdvJsArray extension

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

Available on JsArray<E>, provided by the AdvJsArray extension