Skip to content

Instantly share code, notes, and snippets.

@eimihar
Created February 6, 2015 03:15
Show Gist options
  • Save eimihar/acf275dd152545ca01fb to your computer and use it in GitHub Desktop.
Save eimihar/acf275dd152545ca01fb to your computer and use it in GitHub Desktop.
hort to vert
var hortToVert = function(arrays)
{
var result = [];
for(var i in arrays)
{
for(var no in arrays[i])
{
if(!result[no]) result[no] = [];
result[no].push(arrays[i][no]);
}
}
return result;
}
console.log(hortToVert([['a','b','c','d'], ['1','2','3','4'], ['!','@','#','$']]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment