Home / CSE / Javascript - CS :: Classes and Modules

CSE :: Javascript - CS

  1. The maximum number of global symbols a module can define is

  2. A.

     2

    B.

     3

    C.

     1

    D.

     4

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. To define each of the set classes as a property of the sets object (namespace) for the module, the statement is

  4. A.

     sets = sets.AbstractEnumerableSet.extend();

    B.

     sets.SingletonSet = sets.AbstractEnumerableSet.extend(...);

    C.

     sets.SingletonSet = sets.extend(...);

    D.

     sets = sets.extend(...);

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Consider the following statement

    var Set = sets.Set;

    var s = new Set(1,2,3);

    What could be the efficiency quotient of the above two statements ?

  6. A.

     The programmer imports at once the frequently used values into the global namespace

    B.

     There is no efficiency quotient, the programmer tries to make it inefficient

    C.

     The programmer needs to import the Sets everytime he wants to use it

    D.

     All of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. The scope of a function is also called as

  8. A.

     The functionā€™s scope

    B.

     Module function

    C.

     Modulated function

    D.

     Private function

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Modules that have more than one item in their API can

  10. A.

     Assign itself to a global variable

    B.

     Invoke another module of the same kind

    C.

     Return a namespace object

    D.

     Invoke another module of the same kind

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. The provides() function and the exportsobject are used to

  12. A.

     Register the moduleā€™s API and Store their API

    B.

     Store the moduleā€™s API and register their API

    C.

     Store the moduleā€™s API

    D.

     None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. Consider the following code snippet

    var sets = com.davidflanagan.collections.sets;

    What is the programmer trying to do in the above code snippet?

  14. A.

     Importing a single module

    B.

     Importing a module partially

    C.

     Importing a namespace

    D.

     Importing the entire module

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. The properties() method is a

  16. A.

     Enumerable method

    B.

     Non-enumerable method

    C.

     Operational method

    D.

     None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. What can be done in order to avoid creation of global variables in JavaScript?

  18. A.

     To use a method that defines all the variables

    B.

     To use an object that has the reference to all the variables

    C.

     To use an object as its namespace

    D.

     To use global functions

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. The ā€˜$ā€™ present in the RegExp object is called a

  20. A.

     character

    B.

     matcher

    C.

     metacharacter

    D.

     metadata

    View Answer

    Workspace

    Discuss Discuss in Forum