title: Simple ways to transform form's data into JSON object
body: <p>I want to transform values from form's fields into JSON object, but I want it to be in a specific format. Something like this:</p>
  
  <pre><code>{name: "John", surname: "Smith"}
  </code></pre>
  
  <p>Is there an easy way to do it? I don't want to build each field manually since there might be a lot of them, and I don't want to do it this way</p>
  
  <pre><code>var data = JSON.stringify($("#newUserForm").serializeArray());
  </code></pre>
  
  <p>because in this case, JSON will look something like this:</p>
  
  <pre><code>[{"name":"name","value":"John"},{"name":"surname","value":"Smith"}]
  </code></pre>
  
  <p>Maybe there are some jQuery plugins or other tricks to do it in one line of code?</p>