JavaScript_Objects_quiz_md - brainchildservices/curriculum GitHub Wiki
-
Which of these is a valid line of JS code that stores an object in a variable?
A. var me = {age=31, hair='brown'};
B. var me = {age: 31, hair: 'brown'};
C. var me = {var age=31, var hair='brown'};
Ans: B
-
A JavaScript object is a collection of -------
Ans. Named Values
-
Which of the following is the literal way to create an object with a property x of value 10?
A. {x: 10}
B. new Object({x: 10})
C. both a & b
D. none
Ans:A
-
Objects can contain objects as property values. True or false?
A.TRUE
B. FALSE
C. NONE
Ans: A
-
An object is an un-ordered collection of ………………………, each of which has a name and a value.
A) properties
B) names
C) values
D) All of the above
Ans: A
-
The ……………………… attribute of an object specifies whether the value of the property can be set.
A) readable
B) writable
C) enumerable
D) configurable
Ans:B
-
The …………………….. attribute of an object specifies whether the property can be deleted and whether its attributes can be altered.
A) readable
B) writable
C) enumerable
D) configurable
Ans : D
-
An object’s ……………………….. is a reference to another object from which properties are inherited.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag
Ans: B
-
An object’s …………………… is a string that categorizes the type of an object.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag
Ans: C
-
An object’s ………………………. specifies whether new properties may be added to the object.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag
Ans : D
-
A ……………………. object is any object created by the execution of JavaScript code.
A) native
B) host
C) user-defined
D) remote
Ans: C
-
JavaScript objects can be created with the new keyword, and with the ………………. function.
A) object()
B) object.create()
C) JavaScript.object()
D) create.object()
Ans: B
-
An ……………………… is a comma-separated list of colon separated name: value paris, enclosed within curly braces.
A) object prototype
B) object literal
C) object class
D) associative arrays
Ans: B
-
An ………………………. is an expression that creates and initializes a new and distinct object each time it is evaluated.
A) object prototype
B) object literal
C) object class
D) associative arrays
Ans: B
-
The …………………… returns true only if the named property is an own property and its enumerable attribute is true.
A) hasOwnProperty()
B) propertyIsEnumerable()
C) getOwnProperty()
D) IsPropertyOf()
Ans:B
-
Properties defined by getters and setters are sometimes known as …………….. to distinguish them from data properties that have a simple value.
A) accessor properties
B) getters properties
C) setters properties
D) getter and setters properties
Ans: A
-
The ………………….. attribute of property descriptor object governs attempts to change the other attributes and also specifies whether the property can be deleted.
A ) writable
B) configurable
C) enumerable
D) value
Ans: B
-
If data property is not configurable, you can’t change its ……………………… attribute from false to true, but you can change it from true to false.
A) writable
B) configurable
C) enumerable
D) value
Ans: A
-
If an accessor property is not ………………………. you can’t change its getter or setter method and you can’t change it to a data property.
A) writable
B) configurable
C) enumerable
D) value
Ans: B
-
The constructor prototype refers to the correct prototype for ………………………… but does not usually do so for objects created with Object.Create( ).
A) object prototype
B) object literal
C) object class
D) associative arrays
Ans:B
-
An object’s …………………. attribute specifies the object from which it inherits properties.
A) prototype
B) class
C) extensible
D) literal
Ans:A
-
An object’s ………………….. attribute is a sting that provides information about the type of the object.
A) prototype
B) class
C) extensible
D) literal
Ans:B
-
The …………………………. attribute of an object specifies whether new properties can be added to the object or not.
A) prototype
B) class
C) extensible
D) literal
Ans: C
-
In order to make an object non extensible, you can pass it to ……………….
A) Object.preventExtensions()
B) Object.seal()
C) Object.lock()
D) Object.freeze()
Ans: A
-
The purpose of ……………………… attribute is to be able to “lock down” objects into known state and prevent outside tempering.
A) prototype
B) class
C) extensible
D) literal
Ans: C
- …………………… works like object.preventExtensions(), but in addition to making the object nonextensible, it also makes all of the own properties of that object non-configurable.
A) Object.preventExtensions()
B) Object.seal()
C) Object.lock()
D) Object.freeze()
Ans:B
- Object ……………………….. is the process of converting an object’s state to a string from which it can later be restored.
A) prototype
B) class
C) extensible
D) serialization
Ans:D
- The type that specifies what kind of event occurred is
A. event type
B. even target
C. both event type and even target
D. none of the mentioned
Ans: A
- Which property specifies the property of the event?
A. Type
B. Target
C. Manner
D. All of the mentioned
- In general, event handler is nothing but
A.function
B.interface
C. event
D. handler