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


  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(...);


  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


  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


  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


  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


  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


  15. The properties() method is a

  16. A.

     Enumerable method

    B.

     Non-enumerable method

    C.

     Operational method

    D.

     None of the mentioned


  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


  19. The ‘$’ present in the RegExp object is called a

  20. A.

     character

    B.

     matcher

    C.

     metacharacter

    D.

     metadata