title: How to remove undefined property from object?
body: <p>I have this object:</p>
  
  <pre><code>  this.prepaidObject = {
              'customerType' : this.prepaidDetailForm.prepaidDetails.customerType,
              'firstName' : this.prepaidDetailForm.prepaidDetails.firstName,
              'lastName' : this.prepaidDetailForm.prepaidDetails.lastName,
              'note' : this.prepaidDetailForm.prepaidDetails.note,
              'created': this.prepaidDetailForm.prepaidDetails.created
          };
  </code></pre>
  
  <p>Now sometimes some of this property are undefined. What i want is if one of <code>this.prepaidDetailForm.prepaidDetails</code> properties are undefined not to display them.  So for example if <code>this.prepaidDetailForm.prepaidDetails.firsName</code> is undefined i dont need to  create <code>'firstName'</code> property isnide object. Any suggestion how can i do that?</p>