Constructor Template


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.