console.log(3+2+'1'); console.log('3'+2+1); var a = 'a'; var b = 'valueof' + (a==='a') ? 'b':'not b'; console.log(b);
<h2>运算符的优先级</h2> 经典错误: <ol> <li>认为都会打印321</li> <li>认为 b = ’valueof b‘;</li> </ol>