Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 8, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/1fb2c32fe290a00f99e8 to your computer and use it in GitHub Desktop.
Save devdays/1fb2c32fe290a00f99e8 to your computer and use it in GitHub Desktop.
Object JavaScript - this when using a new operator
function MyType() {
this.someData = "a string";
}
var instance = new MyType();
// Kind of like the following, but there are more steps involved:
// var instance = {};
// MyType.call(instance);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment