但是有点细微的地方:onclick属性需要提供函数引用——不是函数的字符串名称,而是函数本身的引用。
But there's a slight twist: the onclick property wants to be fed a function reference — not the string name of a function, but a reference to the function itself.
这里不需要调用一个字符一个字符地进行比较的equals函数,相反,您可以通过引用将解析器报告的名称与字符串常量进行比较。
Instead of making calls to equals which compares strings character by character, you can compare names reported by the parser against string constants by reference.
该表达式计算器支持具有“通过值传递”的参数的函数调用,但不支持具有“通过引用传递”的参数、对象、数组、函数和字符串的函数调用。
The expression evaluator supports function calls with By Value arguments but does not support function calls with By Reference arguments, objects, arrays, functions, and strings.
应用推荐