title: How to use trim function on an object to remove whitespaces jquery
body: <p>I have an object 'data' and it has some elements, some of them have null value. When i am printing them instead of whitespace null is printed.</p>
  
  <p>Example:</p>
  
  <pre><code>console.log(data.value1);
  console.log(data.value2);
  console.log(data.value3);
  </code></pre>
  
  <p>Output is :</p>
  
  <pre><code>null
  null
  null
  </code></pre>
  
  <p>But when using </p>
  
  <pre><code>$.trim(data.value1);
  $.trim(data.value2);
  $.trim(data.value3);
  </code></pre>
  
  <p>Problem is solved.</p>
  
  <p>Now how can i use trim on object so i dont have to write same code for all the elements.</p>