Posted By

johndonahue on 12/02/10


Tagged

constructor instanceOf


Versions (?)

Constructor Template


 / Published in: JavaScript
 

URL: http://ejohn.org/apps/learn/#36

  1. /**
  2.  * @constructor
  3.  */
  4. function MyConstructor() {
  5.  
  6. if ( !( this instanceof arguments.callee ) ) {
  7. return new MyConstructor();
  8. }
  9.  
  10. // Props and methods
  11.  
  12. }

Report this snippet  

You need to login to post a comment.