RequireJS MCQ Questions And Answers
RequireJS MCQ : This section focuses on "Basics" of RequireJS. These Multiple Choice Questions (MCQ) should be practiced to improve the RequireJS skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. ___________ is a JavaScript library and file loader which manages the dependencies between JavaScript files and in modular programming.
A. PolymerJS
B. VueJs
C. RequireJS
D. NodeJS
View Answer
Ans : C
Explanation: RequireJS is a JavaScript library and file loader which manages the dependencies between JavaScript files and in modular programming.
2. RequireJS was developed by David Mark and its initial version v1.0.0 was released in ?
A. 2008
B. 2009
C. 2010
D. 2011
View Answer
Ans : B
Explanation: RequireJS was developed by David Mark and its initial version v1.0.0 was released in 2009.
3. Which of the following are Features of RequireJS ?
A. It reduces code complexity in large applications.
B. It allows for easy debugging as it loads the files from plain script tags.
C. It gathers different JavaScript files from different modules at the time of compilation.
D. All of the above
View Answer
Ans : D
Explanation: All of the above are Features of RequireJS.
4. Which provides the usage of non AMD libraries with RequireJS by configuring their dependencies and exporting their global values?
A. baseUrl
B. paths
C. shim
D. map
View Answer
Ans : C
Explanation: Shim : It provides the usage of non AMD libraries with RequireJS by configuring their dependencies and exporting their global values.
5. Which of the following defines the value for script type attribute used in the document?
A. callback
B. xhtml
C. scriptType
D. skipDataMain
View Answer
Ans : C
Explanation: ScriptType : It defines the value for script type attribute used in the document. Default type is "text/javascript".
6. waitSeconds specifies the number of seconds to wait before throwing up on script loading.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, waitSeconds specifies the number of seconds to wait before throwing up on script loading.
7. Module is defined using the ________ function; the same function is used for loading the module as well.
A. declare()
B. define()
C. create()
D. insert()
View Answer
Ans : B
Explanation: Module is defined using the define() function; the same function is used for loading the module as well.
8. Which of the following is true about RequireJS?
A. It is an open source JavaScript library under the MIT license
B. It provides asynchronous module loading.
C. It has the ability to load nested dependencies.
D. All of the above
View Answer
Ans : D
Explanation: All of the above are true about requirejs
9. Which of the following query string arguments are used to fetch all resources that are loaded by using RequireJS?
A. paths
B. urlArgs
C. context
D. callback
View Answer
Ans : B
Explanation: UrlArgs : The query string arguments are used to fetch all resources that are loaded by using RequireJS. It is used for cache busting when there is improper configuration of browser or server.
10. A module can also use a function for frameworks, without having dependencies.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, A module can also use a function for frameworks, without having dependencies.
Discussion