很多js插件源碼都有如下代碼://兼容CommonJs規范if (typeof module !== 'undefined' && module.exports) module.exports = MyPlugin;//兼容AMD/CMD規范if (typeof define === 'function') define(function() { return MyPlugin; });這兩段代碼具體作用是什么呢?對于提高原生插件的編寫能力有沒有相關方面的書籍可以看呢?
關于javascript插件源碼的問題?
楊__羊羊
2019-03-22 15:14:49