嘿,我的 javascript 文件中有三个这样的函数
token .js
const function1 = async (token) => {
.....
};
const function2 = async(token, permission) => {
// I want to call function1 here like
function1(token);
};
module.exports = { function1, function2 }
在 function2
中我想调用函数,它给我一个错误 function1 is not a function
有人知道怎么解决吗?
最佳答案
它应该有效。检查这个:working functions
'use strict';
const function1 = async (token) => {
console.log(token);
};
const function2 = async(token, permission) => {
// I want to call function1 here like
function1(token);
};
function2('apple','ball');
关于javascript - 如何在nodejs中的另一个箭头函数中调用箭头函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49727451/