Skip to content

Array

IT Notes → Javascript @ December 22, 2020

  • To access an element, we can use obj.member or obj[index].
  • The push method adds an element to the end of an array.
  • The pop method removes the items from the end of the array first.
  • The shift method removes elements from the top of the array, which does suit our needs.
  • The unshift method adds items to the top of an array.
  • array.splice(index, howmany, element1, .., elementX).
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x