javascript array: make object property into array key : I have an array of objects like so: 

    arr[0] = {name: 'name1', attribute1: 'a1Value1', attribute2: 'a2Value1'} 
    arr[1] = {name: 'name2', attribute1: 'a1Value2', attribute2: 'a2Value2'}

what I want to achive is to create second array with name attribute as array key so it looks like this:

       arr2[name1] = {attribute1: 'a1Value1', attribute2: 'a2Value1'}
       arr2[name2] = {attribute1: 'a1Value2', attribute2: 'a2Value2'}

Is there an easy and efficient way to do it with underscoreJS or plain JS?