title: how to replace undefined with a empty string
body: <p>I am using jsPdf. When a field has been left blank "undefined" is printed on the pdf. I would like to replace that with a empty string. I am trying to use a if statement but I am not getting it.</p>
  
  <pre><code> doc.text(30, 190, "Budget : $");
      if ($scope.currentItem.JobOriginalBudget == "undefined") {
  
          doc.text(50, 190, " ");
      }
      else {
          var y = '' + $scope.currentItem.JobOriginalBudget;
          doc.text(50, 190, y);
      };
  </code></pre>