0

I am adding two variables which contains some numeric values like this

var beforesale = cost + perc;  // example: (100 + 18)

But instead of giving me result 118, it is giving me result as 10018.

It is merging value because it is not taking plus (+) symbol as addition but instead it is taking symbol as we use to merge html and javascript var.

I seen example of addition but they using plus (+) operator without any issue. But in my case it is not accepting addition. Any idea?

Rishabh
  • 450
  • 2
  • 9
  • 24

0 Answers0