-1

Why making:

var x = prompt(“give a value”)
x = parseInt(x) 
var y = x*2 

Is similar to do

var x = prompt(“give a value”)
var y = x*2

So why we can do the multiplication without making the conversion.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
bib
  • 944
  • 3
  • 15
  • 32

1 Answers1

0

The problem is only with +. In such a case we will get concatenation

bib
  • 944
  • 3
  • 15
  • 32