44个javascript问题-4(来自知乎)
var val = 'smtg';console.log('Value is ' + (val === 'smtg') ? 'Something' : 'Nothing');第一感觉输出Value is Something,但运行后发现输出Something,就是一个优先级的问题,上述代码等价于console.log(('Value is ' + (val === 'smtg')) ? 'S...