Web Designing MCQs

Top 30 Multiple-Choice Questions On the JavaScript Object

Pinterest LinkedIn Tumblr Reddit WhatsApp
This set of multiple-choice questions on the JavaScript objects includes MCQ on JavaScript property attributes, object attributes, and categories of JavaScript objects. It also includes MCQ and interviews questions on object literals, prototypes, inheritance along with deleting properties, testing properties, and enumerating properties of JavaScript.

1. 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

2. The ……………………… attribute of an object specifies whether the value of the property can be set.
A) readable
B) writable
C) enumerable
D) configurable

3. The ………………… attribute of an object specifies whether the property name is returned by a for/in loop.
A) readable
B) writable
C) enumerable
D) configurable

4. 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

5. An object’s ……………………….. is a reference to another object from which properties are inherited.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag

6. An object’s …………………… is a string that categorizes the type of an object.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag

7. An object’s ………………………. specifies whether new properties may be added to the object.
A) Characteristics
B) Prototype
C) Class
D) Extensible flag

8. A ……………………… is an object or class or objects defined by the ECMAScript specification which includes arrays, functions, dates and regular expressions.
A) native object
B) host object
C) user defined object
D) remote object

9. A ……………………. object is any object created by the execution of JavaScript code.
A) native
B) host
C) user defined
D) remote

10. JavaScript objects can be created with the new keyword, and with the ………………. function.
A) object()
B) object.create()
C) JavaScript.object()
D) create.object()

11. 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

12. 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

13. 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()

14. 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

15. 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

16. 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

17. 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

18. 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

19. An object’s …………………. attribute specifies the object from which it inherits properties.
A) prototype
B) class
C) extensible
D) literal

20. An object’s ………………….. attribute is a sting that  provides information about the type of the object.
A) prototype
B) class
C) extensible
D) literal

21. 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

22. 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()

23. 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

24. …………………… 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()

25. ……………….. locks objects down more tightly, in addition to making the object non extensible and its properties non configurable, also makes all of the objects own data properties read only.
A) Object.preventExtensions()
B) Object.seal()
C) Object.lock()
D) Object.freeze()

26. 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

27. ECMAScript 5 provides native functions ……………… to serialize and restore JavaScript objects.
i) JSON.Stringify()   ii) JSON.Objectify()   iii) JSON.Parse
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii and iii

28. JSON stands for …………………………… and it’s syntax is very similar to that of JavaScript object and array literals.
A) JavaScript Object Notation
B) JavaScriptOrientedNotation
C) JavaScriptObjectNumber
D) JavaScriptOnNotation

29. ………………….. serializes only the enumerable own properties of an object.
A) JSON.Parse()
B) JSON.Stringify()
C) JSON.Null()
D) JSON.Objectify()

30. NaN, Infinity and -Infinity are serialized to ………………………. in JSON.
A) null
B) infinity
C) undefined
D) NaN

Answers

1. A) properties
2. B) writable
3. C) enumerable
4. D) configurable
5. B) Prototype
6. C) Class
7. D) Extensible flag
8. A) native object
9. C) user-defined
10. B) object.create()
11. B) object literal
12. B) object literal
13. B) propertyIsEnumerable()
14. A) accessor properties
15. B) configurable
16. A) writable
17. B) configurable
18. B) object literal
19. A) prototype
20. B) class
21. C) extensible
22. A) Object.preventExtensions()
23. C) extensible
24. B) Object.seal()
25. D) Object.freeze()
26. D) serialization
27. C) i and iii only
28. A) JavaScript Object Notation
29. B) JSON.Stringify()
30. A) null

Read Next: Top 20 Multiple Choice Questions on JavaScript Arrays

Please follow and like us:
RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
linkedIn | Top 30 Multiple-Choice Questions On the JavaScript Object
Share

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Write A Comment

RSS
Follow by Email
X (Twitter)
Visit Us
Follow Me
YouTube
YouTube
LinkedIn
Share