InterviewSolution
| 1. |
What is the drawback of creating a true private in JavaScript? |
|
Answer» One of the drawbacks of creating a true private METHOD in JavaScript is that they are highly memory consuming. A new copy for each method is created for every instance. Example:var Employee = function (name, company, salary) { Here, while creating each variable, each instance makes a new copy of emp1, emp2, and emp3 in IncreaseSalary. Thus, MAKING it INEFFICIENT for your SERVER end. |
|