ExamVeda
Login
Home
1
The behaviour of the instances present of a class inside a method is defined by
Discuss
Answer & Solution
Answer: Option B
Solution:
The behaviour of the instance of a class is defined by the class and is shared by all instances.
2
The keyword or the property that you use to refer to an object through which they were invoked is
Discuss
Answer & Solution
Answer: Option C
Solution:
The ‘this’ keyword is used to refer to the object through which the properties or methods were invoked. This use of ‘this’ is a fundamental characteristic of the methods of any class.
3
Consider the following code snippet :
var o = new F();
o.constructor === F
The output would be :
Discuss
Answer & Solution
Answer: Option B
Solution:
The result is true: the constructor property specifies the class.
4
The basic difference between JavaScript and Java is
Discuss
Answer & Solution
Answer: Option D
Solution:
The basic difference between JavaScript and Java is that the functions are values, and there is no hard distinction between methods and fields.
5
The meaning for Augmenting classes is that
Discuss
Answer & Solution
Answer: Option A
Solution:
JavaScript’s prototype-based inheritance mechanism is dynamic: an object inherits properties from its prototype, even if the prototype changes after the object is created. This means that we can augment JavaScript classes simply by adding new methods to their prototype objects.
6
The property of JSON() method is:
Discuss
Answer & Solution
Answer: Option C
Solution:
The JSON format is intended for serialization of data structures and can handle JavaScript primitive values, arrays, and plain objects. It does not know about classes, and when serializing an object, it ignores the object’s prototype and constructor. If you call JSON.stringify() on a Range or Complex object, for example, it returns a string like {“from”:1, “to”:3} or {“r”:1, “i”:-1}.
7
When a class B can extend another class A, we say that
Discuss
Answer & Solution
Answer: Option A
Solution:
Instances of B inherit all the instance methods of A. The class B can define its own instance methods, some of which may override methods of the same name defined by class A.
8
If A is the superclass and B is the subclass, then subclass inherting the superclass can be represented as
Discuss
Answer & Solution
Answer: Option C
Solution:
The subclass B inherits the prototype of the class A.
9
The snippet that filters the filtered set is
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
The method that can be used to create new properties and also to modify the attributes of existing properties is
Discuss
Answer & Solution
Answer: Option C
Solution:
When used to define new properties, any attributes you omit default to false. Therefore, both Object.defineProperty() and Object.defineProperties() can be used to create and modify the attributes.