Example:
Code:

<html>
<body>
<script type="text/javascript">
var a;
a=10+10;
document.write(a);
document.write("
"); a="10"+"10"; document.write(a); document.write("
"); a=10+"10"; document.write(a); document.write("
"); a="10"+10; document.write(a); document.write("
"); </script> </body> </html>

Output:

20
1010
1010
1010

Note: If you add a number and a string, the result will be a string.

eXTReMe Tracker