addyosmani / essential-js-design-patterns

Repo for my 'Learning JavaScript Design Patterns' book
http://addyosmani.com/resources/essentialjsdesignpatterns/book/
4.82k stars 791 forks source link

Singleton code example simplification #176

Open svenheden opened 9 years ago

svenheden commented 9 years ago

This simplifies the singleton code example by comparing object references instead of random numbers.

This is just a proposal, I'm not 100% sure this makes the code example more clear, but maybe. :)

I think it shows the intent of the comparison in the end more, and the random number disclaimer is no longer needed.