title: How to convert variables into json?
body: <p>I want to send json data to ajax but how do you convert variables into json or convert an array to json?</p>
  
  <pre><code>$(".confirm_order").click(function(event) {
      event.preventDefault();
  
      var street = $("#street").val();
      var location = $("#location").val();
      var number = $("#number").val();
  
      var f = ???
  
              $.ajax({
              type: 'post',
              url: "/orders",
              dataType: "json",
              data: f,
              success: function (l) { 
                  alert("Done");
              }
              });
  });
  </code></pre>