JavaScript Fundamentals
A quick guide to JavaScript Arrays
What they are and how to start using them effectively
Introduction
Arrays are a structure common to all programming languages so knowing what they are and having a firm grasp on what you’re able to accomplish with Arrays will take you a long way in your journey as a software developer. The code examples I share in this post will be in JavaScript but the concepts are common among all languages. What you learn here can easily be translated to any other language you work with.
In this post I’ll be covering how to perform the create, read update and delete operations using arrays, some common functions that come with the Array prototype and also how to implement them.
What is an Array
Before we jump into the juicy bits of Arrays, lets quickly gloss over what they are. Arrays
- are a fundamental data type in JavaScript
- are an ordered collection of values called elements that are stored at and accessed via an index
- are untyped, meaning that the elements of an array could be of different types. This allows us to create complex arrays such as an array of objects or even an array of arrays…