Question: What is the MAIN reason for creating object methods ( functions ) using the 'prototype' keyword instead of embedding the teacherFullName method in the object
What is the MAIN reason for creating object methods functions using the 'prototype' keyword instead of embedding the teacherFullName method in the object definition itself?
function Coursename teacherFirst, teacherLast
this.namename;
this.teacherFirstteacherFirst;
this.teacherLastteacherLast;
this.students;
lets move this class to a prototype
thisteacherFullName
return $teacherFirst $teacherLast;
Course.prototype.teacherFullName
return $teacherFirst $teacherLast;
Group of answer choices
Code is easier to read
It's required
To keep it from being duplicated with each object instance
We don't want to share it with other class instances
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
