Array methods
Array.prototype.push()
Appends values in argument order and mutates the receiver. Returns the resulting length, not the array.
Formal Syntax & Structure
javascript syntaxjavascript
array.push(...items)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| items | any | Zero or more appended values. |
Return Value
Number
New length.
Working Example
Example Snippetjavascript
const a=[2];console.log(a.push(4,6),a.join(","));