title: Output NaN of addition two number in Angular 5
body: <p>I am trying to multiply two number and add another number but the output is shown NaN. How to solve this?</p>
  
  <p>Here my code</p>
  
  <pre><code>medicines = [new Medicine()];
  
  this.sum = 0;// sum also type of number
  
  for (let i = 0; i &lt; this.medicines.length; i++)
  {
      this.sum = this.sum + this.medicines[i].price * this.medicines[i].quantity;//here price and quantity of type number
      console.log(typeof this.sum);//but this print NaN
  }
  </code></pre>
  
  <p>Model of medicines</p>
  
  <pre><code>export class Medicine{
     constructor(){}
     name: String;
     quantity:number;
     price:number
  }
  </code></pre>