I previously compared these two values by their base-64 encryption. I have now noticed that their original values only differ in whitespaces.
In javascript, why data and JSON.stringify(JSON.parse(data)) are different when console.log? How can I unparse data so that unparse(parse(data) is same as its original?
For example:
console.log(data);
console.log($.base.btoa(JSON.stringify(JSON.parse($.base.atob(data)))));
Their base-64 encryptions differ visibly, yet their unencrypted data only differ in whitespaces.
When log data: {id: 1}
When log JSON.stringify(JSON.parse(data)): {id:1}
Yet, is there a way to stringify with whitespaces like the format of data without extra effort?