Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Constructor can also be written like this


const p = new Person.prototype.constructor("name name");
console.log(p.name);

/*the above is another way to write new Person("name name)*/
/*below is also legal code*/
person =  Person.prototype.constructor;

const p1 = new person("name name name");
console.log(p1.name);
 
PREVIOUS NEXT
Tagged: #Constructor #written
ADD COMMENT
Topic
Name
4+9 =