I want to use the _.zip function of Underscore.js to create pairs from two arrays.
var a = ["alpha", "beta", "gamma"];
var b = ["one", "two", "three"];
var pairs = _.zip(a, b);
alert("pairs = " + pairs);
This seems to work fine when done with integers however when using strings the result is confusing:
pairs = 3,3,3,3,3,3
Instead I expect the following result:
pairs = [["alpha", "one"], ["beta", "two"], ["gamma","three"]]
Update:
Thanks to the comments I discovered that the described behavior does apply to Chromium running on Ubuntu. However the expected result is return when I run the same script in Firefox on Ubuntu.