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

CSE :: Javascript - CS

  1. The four kinds of class members are

  2. A.

     Instance methods, Instance fields, Static method, Dynamic method

    B.

     Instance fields, Instance methods, Class fields, Class methods

    C.

     Instance fields, Non-instance fields, Dynamic methods, Global methods

    D.

     Global methods, Local methods, Dynamic methods, Static methods


  3. The properties of the objects act like different kinds of class members. They are

  4. A.

     Public object, Private object, Protected object

    B.

     Constructor object, Function object, Destructor object

    C.

     Constructor object, Prototype object, Instance object

    D.

     Instance method, Static object, Dynamic object


  5. The object whose properties are inherited by all instances of the class, and properties whose values are functions behaving like instance methods of the class, is

  6. A.

     Instance object

    B.

     Constructor object

    C.

     Destructor object

    D.

     Prototype object


  7. Which are usually variables that are used internally in object methods and also are globally visible variables?

  8. A.

     Object properties

    B.

     Variable properties

    C.

     Method properties

    D.

     Internal properties


  9. The class that represents the regular expressions is

  10. A.

     RegExpObj

    B.

     RegExpClass

    C.

     RegExp

    D.

     StringExp


  11. Which is the correct code that returns a complex number that is the complex conjugate of this one?

  12. A.

     Complex.prototype.conj = function() { return new Complex(this.r, -this.i); };

    B.

     Complex.prototype.conj = function() { return Complex(this.r, -this.i); };

    C.

     Complex.prototype.conj = function() { return (this.r, -this.i); };

    D.

     Complex.prototype.conj = function() { new Complex(this.r, -this.i); };


  13. How can we make methods available on all objects?

  14. A.

     Object.add(methods)

    B.

     Object.methods(add)

    C.

     Object.add.methods(…)

    D.

     Object.prototype


  15. What is the procedure to add methods to HTMLElement so that they will be inherited by the objects that represent the HTML tags in the current document?

  16. A.

     HTMLElement.prototype(…)

    B.

     HTMLElement.prototype

    C.

     HTML.addmethods()

    D.

     HTML.elements(add)


  17. You can refresh the webpage in JavaScript by using

  18. A.

     window.reload

    B.

     location.reload

    C.

     window.refresh

    D.

     page.refresh


  19. The functions provide() and require() of Dojo toolkit and Google’s Closure library are used for

  20. A.

     declaring and loading modules

    B.

     loading and declaring modules

    C.

     declaring modules

    D.

     none of the mentioned