明明和老师敲得代码是一样的,但是就是运行报错
student.js
function add(student){
console.log("Add Students"+student);
exports.add=add;
}
/**************************************/
teacher.js
function add(teacher){
console.log("Add Teacher"+teacher);
exports.add=add;
}
/**************************************/
classes.js
var student=require("./student");
var teacher=require("./teacher");
function add(teacherName,students){
teacher.add(teacherName);
students.forEach(function(item,index){
student.add(item)
})
}
exports.add=add;
/*************************************/
index.js
var classes=require("./classes");
classes.add("Scott",["白富美","高富帅"]);