We typically don't think about arrays when dealing with performance, but it's worth mentioning a few things here. First, large arrays can be messy and performance hogs when you're trying to work with a large amount of data. Typically with arrays, we only need to worry about two things: searching and array size.
Let's create an array that has a lot of values in it; here I've created an array called
myArray which has 1001 values within, with a string value of key and the index of the array. You can grab the full version in the
06_09.js file inside the
Chapter_6 folder of the example code on the Packt Publishing's website. Here's a part of the code sample of the total array:
There are two ways to look up a ...