I have an array such as var arr = ["Dog", "Cat", "Horse", "Pig", "Cow"]; and I would like to be able to loop through the array to create an object from each element.
var zoo = {
Dog : {
color: brown,
age: 4
},
Cat : {
color: black,
age: 12
I have found some solutions for defining the other properties with .keys and .values but I am stuck on how to name the object. Thanks for any help!