Introduction 💡

One data structure that many other complex ones build off of is the humble array. Therefore, it’s important to have a strong foundational understanding and knowledge of arrays before diving into other data structures. In this post, we will cover what arrays are, how to create them, and 20 methods ranging from ones you will commonly use, some that are a bit more complex (mainly because of callback functions), and some fun ones to know as well.

Before you go, if you’re interested in learning more data structures and want another resource for algorithms, check out the series Megan Lo and I are collaborating on! The series will focus on data structures and algorithms, and our first post covers the crossover of Strings and Arrays.

Without further ado, let’s dive into the wonderful world of arrays!

P.S. Since this is a very long post, feel free to skip around as you like 😉

Table of Contents

  • What are arrays?
  • How do we create arrays?
    * Bonus! Spread Operator
  • Methods
    * Basic Methods:  pop,  push,  shift,  unshift,  splice,  slice
    * Bonus! Length property
    * Advanced Methods:  reduce,  sort,  concat,  flat,  filter,  join,  map,  find,  forEach
    * Fun Methods:  toString,  includes,  fill,  indexOf,  findIndex
  • Conclusion

#arrays #javascript #web-development #programming #developer

Everything JavaScript Arrays & Array Methods!
2.00 GEEK