setAsObject method
void
setAsObject(
- dynamic index,
- dynamic value
Sets a new value to array element specified by its index. When the index is not defined, it resets the entire array value. This method has double purpose because method overrides are not supported in JavaScript.
index
(optional) an index of the element to setvalue
a new element or array value.
Implementation
void setAsObject(dynamic index, dynamic value) {
if (value == null) {
clear();
var elements = ArrayConverter.toArray(index);
append(elements);
} else {
_values[index] = value;
}
}