Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 140byt.es::forcetor
  2. =========
  3.  
  4. A 116 byte tweet-sized snippet of code you can paste into ANY constructor function without modification to force use as a constructor.
  5.  
  6. How to use
  7. -----------
  8.  
  9. Use the constructor with or without new, and receive back an instance object.
  10.  
  11. OR...
  12.  
  13. Copy and paste the following code into the top of your constructor (116 chars):
  14.  
  15. var a=arguments,b=a[0],c=a.callee;if(!(this instanceof c))return new c(a);if(c==b.callee)return c.apply(this,b);