3 ms·
This method is less efficient than using prototypes because the created instance will lug around an object with its own function, instead of sharing one. Someti
by anonytrary 8y ago
This method is less efficient than using prototypes because the created instance will lug around an object with its own function, instead of sharing one. Sometimes I use "factories" for cases where my instance only needs one method or if the number of instances is going to be relatively small.