當前位置:編程學習大全網 - 網站源碼 - nodejs 中 module.exports 和 exports 的區別

nodejs 中 module.exports 和 exports 的區別

module.exports可以單獨的定義,返回數據類型,而export只能是返回壹個object對象。如

module.exports=['勞黑炭','百度經驗','module.exports'];//正確

exports=['勞黑炭','百度經驗','module.exports'];//報錯

  • 上一篇:qt中通過重寫run方法創建線程與通過movetothread方法有什麽區別
  • 下一篇:易語言夢三國全圖源碼
  • copyright 2024編程學習大全網