append()

Append an element to an array.

Signature

append(element: T): Array<T>

Description

The append() method appends the given element to the array.

The source array isn’t changed.

Parameters

Parameter Type Required Description

element

Any

Yes

Element to append to the array.

Return value

Type Description

Array

Array with element appended to the source elements.

Examples

[1, 2].append(3)
[
  1,
  2,
  3
]

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!