Javascript parser for simple expression

后端 未结 6 2248
再見小時候
再見小時候 2020-12-05 03:57

I would like to find a javascript parser that can handle and evaluate simple expressions. The parser should be able to evaluate the regular mathematical expressions, and sup

6条回答
  •  孤街浪徒
    2020-12-05 04:23

    Assuming you mean a javascript parser in javascript, you probably want eval()

    see: https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Functions/Eval

    Just note that eval, if used improperly, can represent a security risk.

提交回复
热议问题