[JavaScript] Use `+` opertor to add one string and one number

The rule is: If you add a number and a string, the result will be a string!

Example

x=5+5;
y="5"+5;
z="Hello"+5;

The result of x,y, and z will be:

10
55
Hello5
posted @ 2012-12-12 09:35  卜海清  阅读(202)  评论(0编辑  收藏  举报