ArrayPrepend
Append a value to the start an array
Method Signature
Arguments
Argument
Type
Required
Description
Default
array
modifiableArray
true
The array to prepend to
value
any
true
The value to prepend
Examples
Prepend a value to an array
Uses the arrayPrepend function to prepend a value to the beginning of an array and shifts the positions of the existing elements.
Result: [4,3,2,1]
Prepend a value to an array using the Array member function
Invoking the prepend function on an array is the same as running arrayPrepend.
Result: ['Hurt','Eccleston','Tennant','Smith','Capaldi']
Additional Examples
Related
Last updated
Was this helpful?