Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

HTML/JavaScript questions: A. What is a public method? B. What is a private meth

ID: 3708090 • Letter: H

Question

HTML/JavaScript questions:

A. What is a public method?

B. What is a private method?

C. Why would you use the object.create() method to create an object?

D. What is the difference between the apply() and call() methods?

Explanation / Answer

A. What is a public method? > A method that can be accessed by any object B. What is a private method? > A method that can only be accessed by objects of same type C. Why would you use the object.create() method to create an object? Object.create({}); > object.create() takes an object and returns a object using properties of input argument D. What is the difference between the apply() and call() methods? Both can be called on functions, which they run in the context of the first argument. In call the subsequent arguments are passed in to the function as they are, while apply expects the second argument to be an array that it unpacks as arguments for the called function.