You've said "associative array" (that's not a term used with JavaScript; they're just "objects"), so I'm guessing you want to create an object where selectArray['some id'] will give you name:
var selectArray = {};
$.each(response, function( i, x ){
selectArray[x.id] = x.name;
});
console.log(selectArray);
So for instance, if your response contained three items (id "tjc" => name "T.J. Crowder", id "joeblow" => name "Joe Blow", and id "bozscaggs" => name "Boz Scaggs"), you'd end up with an object that looked like this:
{
"tjc": "T.J. Crowder",
"joeblow": "Joe Blow",
"bozscaggs": "Boz Scaggs"
}
and
selectArray['tjc']
...would give you "T.J. Crowder".
Complete Example: Live Copy
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<meta charset=utf-8 />
<title>Creating a lookup object</title>
</head>
<body>
<p>Look in the console</p>
<script>
(function() {
var response = [
{id: "tjc", name: "T.J. Crowder"},
{id: "joeblow", name: "Joe Blow"},
{id: "bozscaggs", name: "Boz Scaggs"}
];
var selectArray = {};
$.each(response, function( i, x ){
selectArray[x.id] = x.name;
});
console.log(selectArray);
})();
</script>
</body>
</html>