Linked Questions

51 questions linked to/from Zip arrays in JavaScript?
2 votes
1 answer
3k views

I have two arrays that I'd like to combine, but in my searching I've only been able to find Array.concat. let a = [1,2,3,4,5] let b = [6,7,8,9,10] How do I combine these to create the following? let ...
MayaGans's user avatar
  • 1,845
1 vote
3 answers
2k views

I have two separate arrays and I'm trying to create a new nested array that has values grouped together. Can I use the map() method and pair each item inside the map method? There is a similar ...
0 votes
2 answers
2k views

Is it possible to merge (or maybe convert?) two large 1D arrays (of tens of thousands of items) into one 2D array so that columns of 2D array are the element wise items from each of the 1D array? I ...
0 votes
1 answer
379 views

I have two arrays array1=[1,2,3] array2=['one','two','three'] I want the result to be res=[[1,'one'],[2,'two'],[3,'three']] [end of problem] The below line was added just to meet the question ...
0 votes
1 answer
487 views

Is there a function similar to map() that can take more then one array as input. I am talking about something like this: arr1 = [0,1,2]; arr2 = [2,4,6]; result = [arr1, arr2].multiMap((item1, ...
0 votes
0 answers
182 views

I have two arrays, one contain keys and other the values. I want to insert key value pairs in mongodb. var keys = ["item1","item2","item3"]; var values = ["15","14","19"]; I am using insertOne to ...
0 votes
1 answer
88 views

I have two arrays namely a and b. I want to combine first value of a and first value of b as one array and that continues. (i.e) a = ["05:25 PM", "3:05 PM"]; b = [60, 120]; Desired Output: ['05:25 ...
Chris's user avatar
  • 1,316
0 votes
2 answers
59 views

I have two arrays. One contains a series of dates. The other array contains a series of data. What is the best way to combine the two arrays into one array of objects. As an example the first element ...
1 vote
2 answers
55 views

so i have these three arrays: var a = ["one", "two", "three"]; var b = ["a", "b", "c"]; var c = ["1", "2", "...
Adam Baser's user avatar
1 vote
1 answer
58 views

I wanted to merge two arrays like you can fold 2 packs of cards - in ugly code with for loop and assuming same length so no if's for safety it would look like this: const arr = [1,2,3]; const rra = [...
0 votes
1 answer
67 views

In my javascript function i have two single array like this: var row = ["var1","var2","var3"]; var col = ["res1","res2","res3"]; i would create a multidimensional array like: [["var1","res1"],["...
0 votes
2 answers
57 views

I am having two arrays, the first array contains: 1, 2, 3, 4, 5 and the second one contains: 100, 200, 300, 400, 500 the result should be: [ [ '1', '100' ], [ '2', '200' ], [ '3', '300' ], [ '...
0 votes
1 answer
54 views

Hi guys I have this array : [[2,3,0],[0,4,5]] and i want traverse this array like: [[2,0], [3,4], [0,5]] Any recommendations please? I am working with javascript
-1 votes
1 answer
56 views

I have an array of objects. Here is the array: arr = [ { "id": 0, "name": John, }, { "id": 1, "name": Kim, }, ...
Gi S's user avatar
  • 31
-10 votes
2 answers
76 views

I want to write a function to join an array to another but different way : var myNumbers = [10,20,3,4,2] var myOperations = ['+','-','*','/'] I want the operators locate between myNumbers element : ...

15 30 50 per page
1
2 3 4