Single Choice Question

  1. Three major components of JavaScript are
    1. DOM, BOM, ECMAScript
    2. LiveScript, Window, Navigator
    3. ECMAScript, Window, DOM
    4. LiveScript, DOM, BOM
  2. What is the main function of JavaScript?
    1. To provide the business service
    2. To provide the web pages
    3. To display web pages
    4. To create the dynamic web pages
  3. The language used to create the dynamic web pages is
    1. JavaScript
    2. Java
    3. C++
    4. Python
  4. The core components of JavaScript are
    1. ECMAScript
    2. LiveScript
    3. DOM
    4. BOM
  5. The component that maps out an entire page as a hierarchy of nodes is
    1. DOM
    2. BOM
    3. ECMAScript
    4. LiveScript
  6. The component that deals with the browser window and frames is
    1. DOM
    2. BOM
    3. ECMAScript
    4. LiveScript
  7. About JavaScript, which statement is correct?
    1. JavaScript is a scripting language
    2. JavaScript is a programming language
    3. JavaScript is a markup language
    4. JavaScript is a database language
  8. About function of JavaScript, which statement is NOT correct?
    1. JavaScript is an object-based language
    2. JavaScript is a strong typed scripting language
    3. JavaScript is a relatively safe scripting language
    4. JavaScript is an event driven scripting language
  9. The tag that contains JavaScript code is
    1. <script>
    2. <javascript>
    3. <js>
    4. <scripting>
  10. In script tag, which attribute is used to specify the source of script file
    1. type
    2. language
    3. script
    4. src
  11. About the basic syntax of JavaScript, which statement is correct?
    1. JavaScript is case-sensitive
    2. A semicolon may be omitted in most cases when a line break exists
    3. Strict mode is not supported in JavaScript
    4. JavaScript can only be executed on client side
  12. To get the input from the user, which function is correct?
    1. input()
    2. prompt()
    3. get()
    4. import()
  13. To output information to the user on the console, which function is correct?
    1. write()
    2. prompt()
    3. log()
    4. alert()
  14. The correct syntax to write multiple-line comment in JavaScript is
    1. //comment
    2. /*comment*/
    3. <!--comment-->
    4. /**comment*/
  15. The correct syntax to write single-line comment in JavaScript is
    1. //comment
    2. /*comment*/
    3. <!--comment-->
    4. /**comment*/
  16. Which way to use JavaScript is most suitable for code reuse
    1. Write in event handler
    2. External scripts
    3. Use the "link" tag
    4. Use the "script" tag
  17. Where is the best place to insert a JavaScript?
    1. In the bottom of head section
    2. On the top of body section
    3. On the bottom of body section
    4. Any place in HTML

True or False Question

  1. External scripts can be used in any HTML file
  2. ECMAScript is a scripting language, which is core part of JavaScript
  3. JavaScript is used to decorate web pages
  4. JavaScript is used to describe the content of web pages
  5. Function "console.log()" display information on the console
  6. Like other scripting languages, JavaScript is also an interpreted language, which provides a very convenient development process.
  7. JavaScript depends on the browser itself and has nothing to do with the operating environment.

Definition of Term

  1. Strict Mode
  2. JavaScript

Short Answer

  1. What are the components in JavaScript?
  2. What are the major functions of JavaScript?
  3. What are the major functions of BOM?
  4. What are the characteristics of JavaScript?
  5. Explain ways to use JavaScript?