I am a bit confused, I would like to have a function that clears all the properties of an object which is available to all the instances of an object. So, I have added a prototype clear() function. This is the following code:

```
(function () {

Supplier.$inject = [];

angular.module('webclient').factory('Supplier', Supplier);

function Supplier() {

    Supplier.prototype = {
        clear: function () {
            for (var key in this) {
                //skip loop if the property is from prototype
                if (this.hasOwnProperty(key))
                    continue;

                console.log("key:" + key);
                this[key] = undefined;
            }
        },
    }

    return Supplier;
};
})();

```

So, I would like to be able to clear all the properties of the current supplier object. So, if the supplier object had the following properties:

SupplierID:21,
Email:None

I would like to set the properties to undefined. I would use the class as following:

var supplier = new Supplier();

supplier.SupplierID = 21;
supplier.Email = "None";

And to set each property to undefined I would 

supplier.clear();

Any ideas? 

Thanks