Back to Developer Roadmap

Array Methods

src/data/question-groups/javascript/content/array-methods.md

4.0676 B
Original Source

Array methods help you add, delete, or change elements (values) in an array. Some array methods to check out are:

  • push(): The push() method adds one or more elements to the end of an array and tells you the new length of the array in return.
  • pop(): The pop() method removes the last element from an array and returns that element.
  • shift(): The shift() method removes and returns the first element from an array.
  • unshift(): It adds one or more elements to the start of an array and tells you the new length of the array in return.