var _klass = item多次一举,没什么用!
classes === 对象数组
let rooms = require('./rooms'); let _teacherName = "xgqfrms", _students = ["abc", "xyz", "Node.js", "Angular 2", "React 2"]; rooms.room_add(_teacherName, _students); // classes is a obeject array // 对象数组: [{"key": "value"}, {"key": "value"}, {"key": "value"}] module.exports.school_add = (classes) => { classes.forEach((item, index) => { let _teacherName = item.teacherName, _students = item.students; rooms.room_add(_teacherName, _students); }); }