title: How to receive data from json and store it into a variable?
body: <p>I got a piece of code in here:</p>
  
  <pre><code>$.get("/upcase", {text: text})
  .done((data) =&gt; {
      $('#results').prepend('&lt;li&gt;' + data['result'] + '&lt;/li&gt;');
      $('#input').val(''); // reset the textbox
  });
  </code></pre>
  
  <p>Usually the data <code>data['result']</code> will be pass to a html <code>&lt;ul&gt;</code>tag with <code>id="results"</code> to form a list, but what if I want to store it into a variable, how do I achieve that?</p>
  
  <p>At least it does not work like this:</p>
  
  <pre><code>let something = $('#results').val(data['result']);
  </code></pre>