This Quiz contains totally 10 Questions each carry 1 point for you.
1. The behavior of the instances present of a class inside a method is defined by
Method
Classes
Interfaces
Classes and Interfaces
Correct!
Wrong!
2. The meaning for Augmenting classes is that
objects inherit prototype properties even in a dynamic state
objects inherit prototype properties only in a dynamic state
objects inherit prototype properties in the static state
object doesn’t inherit prototype properties in the static state
Correct!
Wrong!
3. When a class B can extend another class A, we say that?
A is the superclass and B is the subclass
B is the superclass and A is the subclass
Both A and B are the superclass
Both A and B are the subclass
Correct!
Wrong!
4. If A is the superclass and B is the subclass, then subclass inheriting the superclass can be represented as
B=inherit(A);
B=A.inherit();
B.prototype=inherit(A);
B.prototype=inherit(A.prototype);
Correct!
Wrong!
5. What will be the output of the following JavaScript code?
var o = new F();
o.constructor === F
var o = new F();
o.constructor === F
false
true
1
0
Correct!
Wrong!
6. The snippet that filters the filtered set is
var t=new FilteredSet(s, {function(s) {return !(x instanceof Set);});
var t=new FilteredSet{function(s) {return !(x instanceof Set);});
var t=new FilteredSet(s, {function(s) {return (x instanceof Set);});
var t=new FilteredSet(s, {function(s) {return x;});
Correct!
Wrong!
7. The method that can be used to create new properties and also to modify the attributes of existing properties is
Object.defineProperty()
Object.defineProperties()
Both Object.defineProperty() and Object.defineProperties()
Object.inherit()
Correct!
Wrong!
8. What will be the output of the following JavaScript code?
const obj1 =
{
a: 10,
b: 15,
c: 18
};
const obj2 = Object.assign({c: 7, d: 1}, obj1);
console.log(obj2.c, obj2.d);
const obj1 =
{
a: 10,
b: 15,
c: 18
};
const obj2 = Object.assign({c: 7, d: 1}, obj1);
console.log(obj2.c, obj2.d);
7,1
18,1
Undefined
Error
Correct!
Wrong!
9. The property of JSON() method is
it can be invoked manually as object.JSON()
it will be automatically invoked by the compiler
it is invoked automatically by the JSON.stringify() method
it cannot be invoked in any form
Correct!
Wrong!
10. The basic difference between JavaScript and Java is
There is no difference
Functions are considered as fields
Variables are specific
Functions are values, and there is no hard distinction between methods and fields
Correct!
Wrong!
Share the quiz to show your results !
Subscribe to see your results
Ignore & go to results
Javascript – Classes – Quiz
You got %%score%% of %%total%% right
%%description%%
%%description%%
Loading...