【发布时间】:2016-07-08 02:17:11
【问题描述】:
如何将属性传递给变量函数? variable() 有效,但是当我尝试传递属性时,我得到 "Uncaught TypeError: variable is not a function"
function firstFunc(a) {
return `${a}`;
}
let variable = firstFunc();
document.write(variable(1));
【问题讨论】:
-
我不知道你想在这里实现什么。
newFunc未定义。 -
这些不是“属性”,它们是“参数”或“参数”。没有“变量函数”之类的东西,但变量可以持有函数。另外,能否请您修改您的帖子以使用一致的名称。
标签: javascript function