This Quiz contains totally 10 Questions each carry 1 point for you.
1. Which of the following is the literal way to create an object with a property x of value 10?
{x: 10}
new Object({x: 10})
both a & b
none
Correct!
Wrong!
2. Suppose that obj is a pure JavaScript object. What will typeof obj return?
"object"
"obj"
"pure object"
NONE
Correct!
Wrong!
3. How can we access the property top-price of an object obj?
bj.top-price
obj["top-price"]
obj.accessProperty("top-price")
Both a & b
Correct!
Wrong!
4. Objects can contain objects as property values. True or false?
TRUE
FALSE
NONE
Correct!
Wrong!
5. Call the method greet shown below.
var obj = {
x: 10,
y: 20,
fx: {
greet: function() { alert("Hello World!"); }
}
}
var obj = {
x: 10,
y: 20,
fx: {
greet: function() { alert("Hello World!"); }
}
}
obj.greet()
obj.fx.greet()
obj.fx.greet
NONE
Correct!
Wrong!
6. A method of an object is simply a property with a function definition as its value. True or false?
TRUE
FALSE
NONE
Correct!
Wrong!
7. It has been told to you that ele is an array. What will ele.constructor return?
The Array constructor definition
The Function constructor definition
The Object constructor definition
both a & c
Correct!
Wrong!
8. In JavaScript, custom classes like those in PHP, Java, C++ can be emulated using what?
Constructors
Methods
The Object() constructor
NONE
Correct!
Wrong!
9. What are the two kinds of objects properties we can have in JavaScript?
Accessor and modifier
Accessor and successor
Modifier and constant
Literal and constructor
Correct!
Wrong!
10. Which property is used to obtain browser vendor and version information?
modal
version
browser
navigator
Correct!
Wrong!
Share the quiz to show your results !
Subscribe to see your results
Ignore & go to results
JavaScript-Objects-Quiz
You got %%score%% of %%total%% right
%%description%%
%%description%%
Loading...