I tried to read and understand jQuery source code. But I can not find information about the next part. I tried to understand the comments next to him, but I can not get any useful value from this.
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
module.exports = jQuery;
} else {
window.jQuery = window.$ = jQuery;
if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function () { return jQuery; } );
}
I also debugged the code and found that module
and define
not undefined
.
I wondered where it came from module
and define
? How can I understand that? What is it used for?
source
share