An associative array is great for storing data that you want to name. For example, if I were storing CSS color data, I would want to name each color according to the CSS property it will be used for, like "background" and "color".
The background color (#ededed) and text color (#0000cc) for this page were stored in an associative array and written out dynamically as CSS using JavaScript.
Here is the code.
// First define a new Array
var aStyle = new Array;
// Now add items to array
// and make it an associative array by setting keys using square brackets
aStyle["background"] = "#ededed";
aStyle["color"] = "#ec0000";
// Now use the associative array while writing out some CSS
// Reference each item via it's key
// For example, aStyle["background"] returns the value #ededed
document.writeln('<style type="text/css">');
document.writeln("body {background:" + aStyle["background"] + ";color:" + aStyle["color"] + ";}");
document.writeln('</style>');