ArrayPush
Adds an element or an object to the end of an array, then returns the size of the modified array.
Method Signature
Arguments
Argument
Type
Required
Description
Default
array
modifiableArray
true
The array to which the element should be appended.
value
any
true
The element to append. Can be any type.
Examples
Push a value onto an array
This is the full function version of arrayPush to push a value onto the end of the array.
Result: This array has 4 elements.
Member function version
Result: This array has 4 elements.
Push an object onto an array
This demonstrates pushing an object onto an array.
Result: This array has 4 elements.
Additional Examples
Related
Last updated
Was this helpful?