Question: Why are objects encapsulated? So that they can act as templates for other objects To create an interface for an app To share their code
Why are objects encapsulated?
So that they can act as templates for other objects
To create an interface for an app
To share their code in a prototype chain
So that the code and data are hidden from other programs
What is an object literal?
A template for the creation of other objects
A native object built into JavaScript
A host object used by the web browser
A standalone object used for a single purpose
Provide the reference to the dateHired property of the employee object in bracket notation.
employee.dateHired
employeedateHired
employeedateHired
employee:dateHired
The new Object command
creates a new object from the JavaScript base object
is used to create an object class
is used to create a closure
creates a new native object
An object class is used
to create standalone objects built for a single purpose
to create native objects
as a template for new objects sharing the same properties and methods
to create host objects
To create an object class, you need an
JavaScript framework
constructor function
object literal
closure
Provide code to instantiate an object from the Employee object class, storing the object in the myEmp variable.
let myEmp new Employee;
let myEmp Employee;
let myEmp : Employee;
let myEmp new Employee
What is an object prototype?
A literal object used for a single purpose
A template for all properties and methods associated with an object class
A constructor function used to create an object class
A host object built into the web browser
Provide code to add the review method to the prototype of the Employee class.
Employee.review function
Employee.prototype.review function
Employee.prototype.review function
Employee.review.prototype function
A closure is a
command block that encloses an objects properties and methods
copy of a variable that encloses that variables value
closed chain of object prototypes
copy of a function along with the lexical environment of variables within that function
What is a privileged method?
A method that takes precedence over other methods in the script
A method created that access private variables and methods but is also accessible to the public
A method associated with an object prototype
A method associated with a native or host object
The hierarchy of objects connected via their prototypes is known as an
prototype chain
prototype tree
object list
object tree
Which object method references the prototype of an object instance?
Object.prototype
Object.getPrototype
Object.getPrototypeOf
Object.loadPrototype
A for in loop is used to
iterate through the contents of an associative array
determine whether an object contains a specified property
iterate through the contents of any array
write the contents of an object in JSON format
Which method should be used to convert text written in JSON to a JavaScript object?
JSON.toObject
JSON.stringify
JSON.construct
JSON.parse
What are some advantages of creating custom objects using objectoriented programming?
Provide code to create an object class named realEstate containing two properties named salesPrice and squareFoot, setting both of those property values to null.
Why should you add a method to the prototype of an object class rather than adding the method to the constructor function of the object class?
What are the advantages and disadvantages of closures?
Why would you place object data in the JSON format?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
