Now, I am wondering if there is a way to combine the two arrays into a single object where the each element of the Keys array become a key to its respective element in the Values array. Kind of like zip() function in Python.
API response could return about 70-80 elements, and each element has about 20-21 attributes, so using an iterator would skyrocket my operations consumption, if I understand correctly.
Thank you so much @samliew, this is perfect, I adjusted just a little bit because “values” is an array and I wanted the first element of it, so I made it like this:
Is there a way I could do what I just did above but to N elements within the listings array? So in the end I would have a structure that holds all data about the vehicles returned in the API response?
For example, if the API returns two vehicles, I would like to have this:
// First car
{"carmake": "Land Rover", "caryear": "2008"},
// Second car
{"carmake": "Audi", "caryear": "2015"}
This works beautifully, thank you. However, I am likely to have a lot of responses (elements) within the array, I think using an iterator is going to consume a lot of operations. I was wondering if it were possible to do this without an iterator and just have a single structure which contains different vehicle data in it. I realize this may not be possible, just wanted to explore different options for optimizations sake.
Yes there is a very advanced method, and it may take a few hours to create, so I will not be suggesting it here.
You can also use the Hire a Pro category to request for private 1-to-1 assistance via video call/screenshare/private messaging/etc. This may help you get your issue resolved faster especially if it is urgent or contain sensitive information. It is important to post your request in the Hire a Pro category, as forum members are not allowed to advertise their services in other categories like here (even if it’s free/unpaid). Posting in the Hire a Pro category will allow other members to assist you over other forms of communication.
Alternatively, you can use the private messaging feature to directly reach out to other forum members. To do this, go to your profile, and click on the “New Message” button:
Hope this helps! Let me know if there are any further questions or issues.