不能光转贴,有空要熟悉之后,要写点心得.现在发现 . 的优先级确实很高. C: Precedence Operator Description Associativity 1 ++ -- Suffix/postfix increment and decrement Left-to-right () Function call [] Array subscripting . Structure and union member access −> Structure and union membe…
JavaScript操作符优先级: 关于最后3个运算符的优先级比较,下面通过一个实例来具体说明: var a,b,c; a = 3,4,5; b = a--,--a,a; c = a ? b++ : ++b; 'a= ' + a + ' b= ' + b + ' c= ' + c alert(a); alert(b); alert(c); 答案是:1,4,3 解释:考查(等号"=".三目运算符"?:".逗号",")的优先级."?&quo…