Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
In javascript, why data and JSON.stringify(JSON.parse(data)) are different?

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!