I have the following arrays:
A=[1,2,3]
B=[6,7,8]
I would like to compose them into JSON format, specifically, as an array of objects. I am trying to write a function that will accept multiple arrays (in the example above A and B) and a corresponding number of keys (in this case: :"arrayA", "arrayB"), and will output them as an array of objects below:
[{"arrayA":1, "arrayB":6},{"arrayA":2, "arrayB":7},{"arrayA":3, "arrayB":8}]