I have this array,
var arr1 = [19, 1, 1, 1, 1];
and another array,
var arr2 = ["Default", "Dynamic", "Assessment", "Risk", "Privacy"];
What I would like is to merge them somehow such that it would look something like this,
var merged_array = [ ["Default", 19], ["Dynamic", 1], ["Assessment", 1], ["Risk", 3], ["Privacy", 2] ];
how would I do that? I tried join but I did not achieve what I wanted. Thanks in advance!
Using a for loop:
This assumes arr1 and arr2 have the same length.