Advertisement
stuppid_bot

делаем возможным вызов конструктора без new

Sep 4th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Foo(v) {
  2.     if (false === this instanceof Foo) {
  3.         return new Foo(v);
  4.     }
  5.     this.value = v;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement