//Unique array fonksiyonu Array.prototype.unique = function() { var unique = []; for (var i = 0; i < this.length; i++) { for (var j = i + 1; j < this.length; j++) { if (this[i] === this[j]) j = ++i; } unique.push(this[i]); } return unique; }; //Implementasyon fonksiyonu Function.prototype.implements = function(interfaces) { var _implements = []; for (var i = 0; i < arguments.length; i++) { _implements = _implements.concat(arguments[i]); } _implements = _implements.unique(); console.log(this.prototype); for (var i = 0; i < _implements.length; i++) { if (!(_implements[i] in this) && !(_implements[i] in this.prototype)) { throw new Error('Implementation failed, ' + _implements[i] + ' should be implemented'); } } } var iAnimal = ['speak', 'walk']; function Animal() {} Animal.implements(iAnimal, ['a']);