Underscore.js Arrays: Zip

by tylerbrownhenry

HTML

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

JavaScript

var testZip = _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);

//re arranges arrays based on there positions
console.log(testZip[0],testZip[1],testZip[2]);
//["moe", 30, true], ["larry", 40, false], ["curly", 50, false]