Awesome, this exactly what I need. I just tweaked the code so that I
don't have to pass object as argument:
colors.makeNonEnumerable('length', 'activeColor');
Object.defineProperty(Object.prototype, 'makeNonEnumerable', {
value: function() {
var propertyName;
var propertyDescriptor;
for (var i=0; i<arguments.length; i+=1) {
propertyName = arguments[i];
propertyDescriptor = Object.getOwnPropertyDescriptor(this, propertyName);
propertyDescriptor.enumerable = false;
Object.defineProperty(this, propertyName, propertyDescriptor);
}
},
enumerable : false,
configurable : true,
});
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]