xxleyi / learning_list

聚集自己的学习笔记
10 stars 3 forks source link

Evaluating Operator Combinations #210

Open xxleyi opened 4 years ago

xxleyi commented 4 years ago

(2 + 4 * 6) * (3 + 12);

To evaluate an operator combination, do the following:

  1. Evaluate the operand expressions of the combination.
  2. Apply the function that is denoted by the operator to the arguments that are the values of the operands.

Thus, the evaluation rule is recursive in nature; that is, it includes, as one of its steps, the need to invoke the rule itself.

这里蕴含着 JS 中 apply method 接收 this, argumentsArray, 而 call method 接收 this, param1, param2, ... 的原因