Answers for "how can you instantiate an object with a custom type person using the new keyword?"

1

new keyword in js

**Important Points** 

1.It creates a new object. The type of this object is object.
2.It sets this new object's internal, inaccessible, [[prototype]] (i.e. __proto__) property to be the constructor function's external, accessible, prototype object (every function object automatically has a prototype property).
3.It makes the this variable point to the newly created object.
4.It executes the constructor function, using the newly created object whenever this is mentioned.
5.It returns the newly created object, unless the constructor function returns a non-null object reference. In this case, that object reference is returned instead.
Note: constructor function refers to the function after the new keyword, as in

new ConstructorFunction(arg1, arg2)
Posted by: Guest on May-22-2020

Code answers related to "how can you instantiate an object with a custom type person using the new keyword?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language