因此,我尝试将代码分离到名为const app2d = require("./app2d");
var a = 10
var b = 20
const total = app2d.sum(a,b);
console.log("The total of A and B is: ", total)
的文件中,这给了我一个奇怪的错误Error messege
app.js中的代码:
function sum(a,b){
return a+b;
}
module.exports = {
sum
};
app2d中的代码:
{{1}}