Hello all,
I hope I am in the correct sub 🙂 Sorry not an expert but trying to play with two json file returned from API call.
Both looks like this :
The thing is when I try to merge with : cat file1 file 2 > ./file_merged
The second file is not part of the first [] which I believe is an array.
Please let me know if it is an easy fix and have a good weekend all !
this is not really jquery related but couldn’t you just do
or if you’re using a modern version of Javascript:
Nice! Simple and short. You can also iterate on the object and save the contents into a new variable. Of course will be a lot more recursive and time consuming. But here it is if you want to eat RAM:
const finalObj = [{}];
for (const item of objectFromApi) {
finalObj.push(item);
}
Members
Online