Remove attributes from a Javascript object
javascript
Solution
Your code seems fine as is. Since `delete` will not delete a property from the prototype, you do not even need to use `hasOwnProperty`.
Problem
How do I remove all attributes from a Javascript object? For example; if I have the following 'class' how can I perform a reset and remove all its attributes: ``` function MyObject() { this.type="blah"; this.name="kkjkj"; } MyObject.prototype.clearAttribs = function() { // I want to remove name, type etc from 'this' // Maybe I can do the following? for (var key in this) delete this[key]; } ```