-1

I have a json object stored inside as an object called

job

It renders as

{"amount": " 12185","job": "GAPA","month": "JANUARY","year": "2010"}

I would like to know how to get it to look like this in jsx/javascript

{
    "amount": " 12185",
    "job": "GAPA",
    "month": "JANUARY",
    "year": "2010"
  }

I was looking around and couldnt find anyone asking the same question

Kenny Quach
  • 225
  • 1
  • 5
  • 18
  • 2
    `JSON.stringify(myJSObject, null, 4)` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify – evolutionxbox Jan 03 '22 at 17:28

1 Answers1

0

It depends on your ide you are using . If you're using VS code you can install prettier / eslint extention to format it to ES6 automatically on save

cpt.John
  • 143
  • 1
  • 9