Skip to content

Instantly share code, notes, and snippets.

@monochromer
Last active August 29, 2015 14:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save monochromer/d2eae337a3fc5b0ba11a to your computer and use it in GitHub Desktop.
Конструкторы, вызывающие сами себя
function myObject () {
if ( !(this instanceof myObject) ) {
return new myObject();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment