title: How to remove \n from json object literal
body: <p>When I write console.log(input), i get the below code but I don,t want to format it in this manner:</p>
  
  <pre><code>var contacts = { json: ' "book": {\n        
  "person": [\n 
  {\n
      "firstName": "Jane",\n 
      "lastName": "Doe",\n
      "age": "25",\n
      "address": {\n
          "streetAddress": "21 2nd Street",\n
          "city": "Las Vegas",\n
          "state": "NV",\n
          "postalCode": "10021-3100"\n
      }\n
  },\n
  {\n
      "firstName": "Agatha",\n
      "lastName": "Doe",\n
      "age": "25",\n
      "address": {\n
          "streetAddress": "21 2nd Street",\n
          "city": "Las Vegas",\n
          "state": "NV",\n
          "postalCode": "10021-3100"\n
          }\n
      }\n
    ]\n
  }' }
  </code></pre>
  
  <p>How to convert above code in the below format?</p>
  
  <pre><code>var contacts = {
      "book": {
          "person": [
              {
                  "firstName": "Jane",
                  "lastName": "Doe",
                  "age": "25",
                  "address": {
                      "streetAddress": "21 2nd Street",
                      "city": "Las Vegas",
                      "state": "NV",
                      "postalCode": "10021-3100"
                  }
              },
              {
                  "firstName": "Agatha",
                  "lastName": "Doe",
                  "age": "25",
                  "address": {
                      "streetAddress": "21 2nd Street",
                      "city": "Las Vegas",
                      "state": "NV",
                      "postalCode": "10021-3100"
                  }
              }
          ]
      }
  }
  </code></pre>