Skip to content

Instantly share code, notes, and snippets.

View danicheman's full-sized avatar

Nick danicheman

  • Santa Cruz, CA
  • 03:12 (UTC -08:00)
View GitHub Profile
@danicheman
danicheman / Array CheatSheet.md
Created April 4, 2025 16:08 — forked from ajeetkumarrauniyar/Array CheatSheet.md
Cheat sheet of Array methods in JavaScript

Array Methods Cheat Sheet

1. push()

  • Definition: Adds one or more elements to the end of an array and returns the new length of the array.
  • Syntax: array.push(element1[, ...[, elementN]])
  • Example:
    let arr = [1, 2, 3];
    arr.push(4, 5);

console.log(arr); // Output: [1, 2, 3, 4, 5]