I used pop instead of shift at the end because of the order of evaluation.
在结尾使用pop而不是shift,是因为计算的顺序。
Precedence or operator strength determines order of evaluation; an operator with higher precedence is evaluated before one of lower precedence.
优先级或者说操作符的强度决定求值顺序;优先级高的操作符比优先级低的操作符先求值。
Expressions like the one above must be avoided. When in doubt, break a large expression into multiple statements to ensure that the order of evaluation is correct.
像上面一样的表达式应该避免。当有歧义时,将一个复杂的表达式分解成多个陈述以保证赋值的顺序是正确的。
You can change the mathematical order of evaluation by using brackets.
你可以利用括号来改变数学的求值顺序。
If the operators all have the same precedence, then the order of evaluation depends on their associativity.
如果所有操作符优先级一样,那么求值顺序就取决于它们的结合性。
When an expression contains more than one operator, the order of evaluation depends on the order of operations.
表达式可能会包含不止一个运算符,这些不同的运算先后次序就是运算符的优先级。
When an expression contains more than one operator, the order of evaluation depends on the order of operations.
表达式可能会包含不止一个运算符,这些不同的运算先后次序就是运算符的优先级。
应用推荐