["item1","black","item2","black","item3","black","item4","black","item5","black"]
function pairs( arr) {
var result = {};
for( var i = 1; i<arr.length; i+=2) result[ arr[i-1]] = arr[i];
return result;
}
pairs(["item1","black","item2","black","item3","black","item4","black","item5","black"]) // {
"item1": "black",
"item2": "black",
"item3": "black",
"item4": "black",
"item5": "black"
}