📜  javascript 模块模式 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.178000             🧑  作者: Mango

代码示例2
const Formatter = (function() {
  const log = (message) => console.log(`[${Date.now()}] Logger: ${message}`);

  const makeUppercase = (text) => {
    log("Making uppercase");
    return text.toUpperCase();
  };  

  return {
    makeUppercase,
  }
})();