.append(val)

Description

Pushes val onto the end of the array and returns the array itself (enabling chaining).

Parameters

  • val — value to push.

Usage

arr = [1,2]
arr.append(3)
log arr // [1,2,3]

Last updated

Was this helpful?