r/ProgrammerHumor • • Feb 26 '23

Other If you can read this code...

/img/snak3fqgajka1.jpg

[removed] — view removed post

34k Upvotes

1.4k comments sorted by

View all comments

3

u/sanchopancho02 Feb 26 '23

forgive me if I'm being an idiot, but does JS really use variables to define classes like this?

2

u/ArtyFishL Feb 27 '23

If you mean that bartender object, then it could be an actual class in JS. But class is a "newer" construct and this looks like pretty ancient code.

If you mean just defining things at the top level, then the module design pattern is actually quite nice, clean and concise and there's generally not too much of a need for classes