Javascript Constructor Overloading
This is a cool little pattern I came up with recently which lets me overload my javascript 'class' constructors. Unfortunately it is only an arity based dispatch and does not inspect the types.
https://gist.github.com/3989227/7b7f36175563caad6f374a49be96901530d9f54e
Written by ilia choly
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#