In fact, you can create a new body object and compare with this object to get properties not added by the browser
i = 0;
document.body['a' + i] = "foo";
document.body['b' + i] = "bar";
var el = document.createElement('body'),
arr = [];
for (var key in document.body) {
if (document.body.hasOwnProperty(key) && !(key in el)) {
arr.push(key);
}
}
Fiddle
will be a little more fantastic
var el = document.createElement('body'),
arr = Object.keys(document.body).filter(function(prop) {
return !(prop in el);
});
source
share