It took almost a day and half to accomplish this, and I still am not sure why it works. If there's a better way(s) to accomplish, I'd love to hear it. In its present state, I hope this helps someone.
var newValuesArray = [];
var arrayIndex = [1, 4, 9];
var valuesArray = [["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"],
["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
];
var roots = valuesArray.map(function(num) {
arrayIndex[num];
return arrayIndex;
});
for (var i = 0, len = roots.length; i < len; i++) {
newValuesArray.push(roots[i].map(function(num) {
return valuesArray[i][num];
}));
}
console.log(newValuesArray);
This is the result I was looking for which the code above produces:
[["One", "Four", "Nine"], ["B", "E", "J"]]
arrayIndexalways be in ascending order? What is the expected result ifarrayIndex = [4, 9, 1];?