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

202
Views
odd behaviour of JSON.parse and JSON.stringify

Ok, so I have an API written in ExprerssJS where I am fetching a value from the Database using Sequelize raw query. Somehow the return JSON result contains backshlashes around the JSON key value e.g. {\"application_id\":1510}.

When I use JSON.parse(JSON.stringify('{\"application_id\":1510}')) inside my expressJs service, it doesn't do anything with supplied JSON object and spits out the input as output.. i.e. no changes though when I use execute this same statement from node command line, I get the desired results where those "" are removed.. see below... This is all on my Mac using same node version. I even tried to run this same command within the Chrome browser's console and can get those "" removed. It just doesn't work within the ExpressJS code.

MC02YC4FLJG5J:~ Dev$ node Welcome to Node.js v16.14.2. Type ".help" for more information.

JSON.parse(JSON.stringify('{\"application_id\":1510}')) '{"application_id":1510}'

Any idea why it behaves differently?

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!