Arrays

Array.push()

Learn how to use Array.push() in JavaScript.

Array.push()

Documentation for Array.push() in JavaScript.

Syntax

arr.push(newItem)

Example

// Practical usage
arr.push(newItem)
console.log("Executed successfully.");

Notes

JavaScript provides powerful built-in methods for the web.

Try It Yourself

You can run JavaScript directly in the BrowserCode Playground.