0
What is typeof exports === 'object' && typeof module === 'object'?
Hey! I saw this piece of code in any javascript code of a website or libraries like jQuery. Code : if(typeof exports === 'object' && typeof module === 'object'){ module.exports = factory(); } else if (typeof define === 'function' && define.amd) { define([], factory); }
5 Antworten
0
typeof returns the type of the variable. So "typeof exports" returns the type of the variable exports.
0
Knäcke Brot what is amd
0
You mean the manufactor of CPUs?
0
Knäcke Brot no,
Asynchronous module definition (AMD)
0
I don't know, but I think this could help you... https://github.com/amdjs/amdjs-api/wiki/AMD