在javascript中将两个数组合并为单个多维数组

问题描述:

status_name=Array("a","b","c","b","e","f");
status_id=Array( 1, 2, 3, 4, 5, 6);

如何组合这两个数组并构建多维数组预期的多维数组就像这样

How to combine these two arrays and to built multi dimensional array Expected Multidimensional array be like this

[["a", 1],["b", 2],["c", 3],["d", 4],["e", 5],["f", 6]]

帮助我如何使用上面两个数组值并构建我预期的多维数组

Help me how to use above two array values and built my expected multidimensional array

我试过自己带来了这个解决方案,这可能会有所帮助一个

I tried Myself and brought this solution, It might help some one

  status_name=Array("a","b","c","b","e","f");
    status_id=Array( 1, 2, 3, 4, 5, 6);

脚本:

            Values=[];
            for (i = 0; i < status_name.length; ++i)
            {
                Values[i] =Array(status_name[i], status_id[i]);
            }