I have an array, with arrays inside it that looks like this:
var arr = [
["title1", "title2", "title3"],
["description1", "description2", "description3"],
["id1", "id2", "id3"]
];
And, I want to take every nth value from the arrays and push it into a new object so it looks like this:
var newArr = [
["title1", "description1", "id1"],
["title2", "description2", "id2"],
["title3", "description3", "id3"],
];
I know I can use a for loop in this case, but am unsure how to get every nth value.
EDIT: The solution was transposing a 2D array, as mentioned by CRice.