Replace Constructor with Factory Function

refactorgram

leadEngineer = new Employee(document.leadEngineer, 'E');

image/svg+xml

leadEngineer = createEngineer(document.leadEngineer);

aliases Replace Constructor with Factory Method