Let's look at the following Javascript code.
<script type="text/javascript" lang="javascript">
function test()
{
alert('2'+8);
alert(8-'2');
}
</script>
In the first alert box, it displays the result of concatenation of 2 and 8 which is 28. In the second alert box, however it displays the subtraction of two numbers which is 6. How?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…