JsArray<E> class
- Implemented types
-
- JsIterable<
E>
- JsIterable<
- Available extensions
- Annotations
-
- @JS('Array')
- @staticInterop
Constructors
- JsArray()
-
Do not use this. Use List directly, ie: final array = [];
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length ↔ int
-
Available on JsArray<
E> , provided by the AdvJsArray extensiongetter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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<
The at() method is equivalent to the bracket notation when index is non-negative. For example, arrayE> , provided by the AdvJsArray extension0
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<
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.E> , provided by the AdvJsArray extension -
copyWithin(
int target, [int? start, int? end]) → JsArray< E> -
Available on JsArray<
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.E> , provided by the AdvJsArray extension -
entries(
) → JsArray< JsArray> -
Available on JsArray<
When used on sparse arrays, the entries() method iterates empty slots as if they have the value undefined.E> , provided by the AdvJsArray extension -
every(
bool fn(E element, int index, JsArray< E> array)) → bool -
Available on JsArray<
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.E> , provided by the AdvJsArray extension -
fill(
E value, [int? start, int? end]) → JsArray< E> -
Available on JsArray<
The fill() method is a mutating method. It does not alter the length of this, but it will change the content of this.E> , provided by the AdvJsArray extension -
filter(
bool fn(E element, int index, JsArray< E> array)) → JsArray<E> -
Available on JsArray<
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.E> , provided by the AdvJsArray extension -
find(
bool fn(E element, int index, JsArray< E> array)) → E? -
Available on JsArray<
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.E> , provided by the AdvJsArray extension -
findIndex(
bool fn(E element, int index, JsArray< E> array)) → int -
Available on JsArray<
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.E> , provided by the AdvJsArray extension -
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 -
next(
) → IteratorResult< T> -
Available on JsIterator<
T> , provided by the PropsIterator extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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 -
toIterable(
) → Iterable< T> -
Available on JsIterator<
T> , provided by the PropsIterator extension -
toList(
) → List< E> -
Available on JsIterable<
E> , provided by the PropsIterable extension -
toLocaleString(
[dynamic locales, dynamic options]) → JsArray< E> -
Available on JsArray<
E> , provided by the AdvJsArray extension -
toString(
) → String -
A string representation of this object.
inherited
-
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 ==(
Object other) → bool -
The equality operator.
inherited
-
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