javascript中string与number相加得到字符串,相减却是数字
var a = "100";
var b = 11;
var c = 9;
var d = "A"
console.log(a+b); //10011
console.log(typeof(a+b)); //string
console.log(a+b-c); //10002
console.log(typeof(a+b-c)); //number
console.log(b-d); //NaN
console.log(typeof(b-d)); //number
console.log(b-d+d); //NaNA