写写LISP,也只在一瞬间

function op(type, a, b) {
  return op.operators[type](a, b);
}
op.operators = {
  '+': function (a, b) {return a + b;},
  '-': function (a, b) {return a - b;},
  '×': function (a, b) {return a * b;},
  '÷': function (a, b) {return a / b;},
  '%': function (a, b) {return a % b;}
};
op('+', op('-', op('×', 20000, 1010), 50000), op('÷', op('%', 963, 1000), 3));
    原文作者:Tulayang
    原文地址: https://www.jianshu.com/p/c9f75cfe0ed3
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞