您认为此代码在性能和潜在的内存泄漏方面是否更好:
const config = require('./config.js');
const db = require('./db.js');
const helper = require('./helper.js');
const local = require('./localization.js');
const signal = require('./signal.js')(config, db, local);
const mail = require('./mail.js')(config, db, local);
const ticket = require('./ticket.js')(db, helper, local, signal);
与未传递参数并在这些模块内重新声明参数相比,后三个模块具有参数(config,db,local等)?
也许不一样,我不知道。