How to Uses Hashes, Maps, and Sets in JavaScript

One of the first thing new JavaScript programmers learn is hashes. Hashes are useful for saving data, nesting data, and in general having a faster Big-O lookup time than arrays*. *Do you know the reason that hashes have O(1) lookup time? IT'S BECAUSE A HASH IS A FUNCTION ! You take in your hash keys, do a bunch of fancy math, and out pops a singular result for each key input. It still sort of blows my mind that a hash is essentially the sort of thing we studied in Algebra 1, only you can input strings, numbers, whatever you want into a hash and it'll still spit out an answer. Of course, all those strings and s and whatnot are of course binary numbers, so it makes a fair amount of sense when you think about it. If you had Aleph-One amount of memory, you could make a hash table for these functions. Hashes are useful for all sorts of things as well - the sorts of things you might encounter in code challenges in particular, like counting up how many of a thing ...