Open tzhg opened 7 years ago
I'm learning JavaScript, and I'm confused as to why the Canvas and ChatClient modules are incorporated as classes.
Because they will only be instantiated once, there won't be any need for inheritance.
So what is the advantage of this over the standard module pattern below? Thanks.
var canvas = (function() { ... })();
I'm learning JavaScript, and I'm confused as to why the Canvas and ChatClient modules are incorporated as classes.
Because they will only be instantiated once, there won't be any need for inheritance.
So what is the advantage of this over the standard module pattern below? Thanks.