I am working with a simple java script code which goes here
<script>
var x=prompt("Enter a number");
var n=x+2;
alert(n);
</scrip>
This code will throws a prompt If i enter 2 in the prompt.I am expecting output as 4,But it is generating 22 in alert. What mistake is happening here.