title: Convert JSON to CSV format using Javascript
body: <p>I'm trying to convert this Javacript Object into a CSV file without any frameworks just in vanilla JS</p>
  
  <p>Following are my json :</p>
  
  <pre><code>[{
      customer_details: {
          firstName: "SEBO",
          lastName: "RAQUI",
          address1: "1990 empty road",
          address2: "",
          address3: "",
          zipcode: "99199",
          country: "US",
      },
      order_details: {
          items: [
              {
                  listPrice: 14,
                  productID: "IEBPTDIEBAIEB119SJM",
                  quantity: 11,
                  description: "RED SHOES",
              },
              {
                  listPrice: 9,
                  productID: "PTDIIEB2886JG10",
                  quantity: 8,
                  description: "WHITE SHIRT",
              },
          ],
      },
      payment: "AMEX",
      shipping: { type: "Express", HSCode: "ARKA10" },
  }]
  </code></pre>
  
  <p>following is the csv format output</p>
  
  <pre><code>customer_details.firstname,customer_details.lastname,customer_details.address1,customer_details.address2,customer_details.address3,customer_details.zipcode,customer_details.country,order_details.items.listPrice,order_details.items.productID,order_details.items.quantity,order_details.items.description,payment,shipping.type,shipping.HSCode
  
  
  SEBO,RAQUI,1990 empty road,,,99199,US,14,EBPTDIEBAIEB119SJM,11,RED SHOES,AMEX,Express,ARKA10
  ,,,,,,,9,PTDIIEB2886JG10,8,WHITE SHIRT,,,
  </code></pre>