My application has a large array of objects, which I stringify and save them to the disk. Unfortunately, when the objects in the array are manipulated, and sometimes replac
If objects in the list does not have same properties, generate a combined master object before stringify:
let arr=[ , , ... ] let o = {} for ( let i = 0; i < arr.length; i++ ) { Object.assign( o, arr[i] ); } JSON.stringify( arr, Object.keys( o ).sort() );