Skip to content

Instantly share code, notes, and snippets.

@youurayy
Created January 19, 2012 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save youurayy/1638914 to your computer and use it in GitHub Desktop.
Save youurayy/1638914 to your computer and use it in GitHub Desktop.
Testing overloadability of native Object members
var ps = [
'__defineGetter__', '__defineSetter__', 'valueOf',
'__lookupGetter__', '__lookupSetter__',
'constructor', 'hasOwnProperty',
'isPrototypeOf', 'propertyIsEnumerable',
'toLocaleString', 'toString' ];
var o = {};
for(var i = 0; i < ps.length; i++)
o[ps[i]] = 'testing ' + i;
for(var i = 0; i < ps.length; i++)
console.log(o[ps[i]]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment