Skip to content

Instantly share code, notes, and snippets.

@kkaefer
Created January 4, 2011 15:39
Show Gist options
  • Save kkaefer/764927 to your computer and use it in GitHub Desktop.
Save kkaefer/764927 to your computer and use it in GitHub Desktop.
Object.defineProperty(global, 'foo', {
set: function(val) {
console.log(val);
}
});
var array = { key: 'value', key2: 'value2', key3: 'value3' };
for (foo in array);
@kkaefer
Copy link
Author

kkaefer commented Jan 4, 2011

Result:

key
key2
key3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment