尽量不要使用全局函数。如果确实需要,那么将该函数封装为类的成员函数。
function readLog() {} function writeLog() {}
class Log { function read() {} function write() {} }