Skip to content

Instantly share code, notes, and snippets.

@swalke16
Created March 29, 2010 18:53
Show Gist options
  • Save swalke16/348242 to your computer and use it in GitHub Desktop.
Save swalke16/348242 to your computer and use it in GitHub Desktop.
function bar()
{
}
bar.prototype.foo = function() {};
var x = new bar();
x.constructor ==> bar() // this seems correct
// doing obj.prototype = {} seems to hose the constructor property
function foo(options)
{
}
foo.prototype = {
bar: function() {}
}
var x = new foo();
x.constructor ==> Object() // Shouldn't this be equal to foo(options)???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment