javascript map key value array to object