var a=1; var b="2"; console.log(a+b); //12 console.log(a+Number(b)); //3 一元加号操作符也可以做到强制转换 console.log(a+ +b); //3