Explanation of define of the RequireJS library

前端 未结 4 1173
悲哀的现实
悲哀的现实 2021-01-30 08:29

I started to read several tutorials about RequireJS. In none of them was the \"define\" keyword explained satisfactorily for me. Could someone help me with the following :

4条回答
  •  时光取名叫无心
    2021-01-30 09:07

    I found this page Why AMD? very helpful. To summarize from this page, AMD specification is helpful in overcoming "write a bunch of script tags with implicit dependencies that you have to manually order" problem. It is helpful in loading the dependencies before executing the required functions, similar to import in other programming languages like python. AMD also prevents the global namespace pollution problem. Check "It is an improvement over the web's current "globals and script tags" because" section.

提交回复
热议问题