Underscore.js Arrays: Object

by tylerbrownhenry

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<a target="parent" href="http://underscorejs.org/#object">Learn More</a>

JavaScript

//converts an array to an object
var testObj = _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
console.log(testObj);
//Object {moe: 30, larry: 40, curly: 50}