ExamVeda
Login
Home
11
The four kinds of class members are
Discuss
Answer & Solution
Answer: Option B
Solution:
The four kinds of class members are Instance fields, Instance methods, Class fields, Class methods.
12
The properties of the objects act like different kinds of class members. They are
Discuss
Answer & Solution
Answer: Option C
Solution:
In JavaScript, there are three different objects involved inany class definition, and the properties of these three objects act like different kinds of class members namely, Constructor object, Prototype object, and Instance object.
13
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
Discuss
Answer & Solution
Answer: Option D
Solution:
The properties of the prototype object are inhertied by all instances of the class, and properties whose values are functions behave like instance methods of the class.
14
Which are usually variables that are used internally in object methods and also are globally visible variables?
Discuss
Answer & Solution
Answer: Option B
Solution:
The variable properties are usually variables that are used internally in the objects methods, but can also be globally visible variables that are used through the page.
15
The class that represents the regular expressions is
Discuss
Answer & Solution
Answer: Option C
Solution:
The JavaScript RegExp class represents regular expressions, and both string and RegExp define methods that use regular expressions.
16
Which is the correct code that returns a complex number that is the complex conjugate of this one?
Discuss
Answer & Solution
Answer: Option A
Solution:
The above code snippet returns a complex number that is the complex conjugate of this one.
17
How can we make methods available on all objects?
Discuss
Answer & Solution
Answer: Option D
Solution:
It is possible to add methods to Object.prototype, making them available on all objects. This is not recommended, however, because prior to ECMAScript5, there is no way to make these add-on methods nonenumerable, and if you add properties to Object.prototype, those properties will be reported by all for/in loops.
18
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?
Discuss
Answer & Solution
Answer: Option B
Solution:
It is implementation-dependent whether classes defined by the host environment (such as the web browser) can be augmented using Object.prototype. In many web browsers, for example, you can add methods to HTMLElement.prototype and those methods will be inherited by the objects that represent the HTML tags in the current document.
19
You can refresh the webpage in JavaScript by using
Discuss
Answer & Solution
Answer: Option B
Solution:
One can refresh the webpage in JavaScript by using location.reload.
20
The functions provide() and require() of Dojo toolkit and Google’s Closure library are used for
Discuss
Answer & Solution
Answer: Option A
Solution:
Both the Dojo toolkit and Google’s Closure library define provide() and require() functions for declaring and loading modules.