Index arrays are the normal arrays you’ve probably learned in programming books. It’s a set of items of the same datatype, and each individual element can be referenced with a single number known as the index.
Associative arrays (also known as maps) are almost the same thing. They are essentially arrays, but instead of being forced to use a number as the index, you can use virtually anything you want (albeit you have to define what datatype you will use as an index beforehand). It’s incredibly useful.
As an example of associative arrays, say you are given a bunch of strings (“abc”, “abc”, “bcd”) as input and your task is to calculate the number of occurrences of each string. This is an incredibly simple task to do with associative arrays. Simply define an associative array of variable length, and do something like
array[“abc”] = array[“abc”] + 1;
(this isn’t the actual way you reference elements with associative arrays, but I will use it just to give you the idea)