Skip to content

Instantly share code, notes, and snippets.

@mpenet
Created June 2, 2011 07:08
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 mpenet/1004051 to your computer and use it in GitHub Desktop.
Save mpenet/1004051 to your computer and use it in GitHub Desktop.
var T = function(){ this.t = function(){return 't'} };
T.prototype.tp = function(){return 'tp'};
var inst = new T();
console.log(inst.hasOwnProperty('t'), inst.hasOwnProperty('tp'))
console.log(inst.t(), inst.tp())
>> true false
>> t tp
console.log(T.prototype.t, T.prototype.tp)
>> undefined function (){return 'tp'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment