It creates a bunch of objects. How to make, that created objects could inherit through prototype?
<script> function Red() { this.pl = 'polska'; this.bel = 'belarus' } Red.prototype.country = function () { return this.bel } function Class(dz) { //Red.call(this); var obj = {}; obj.value = dz; // свойство obj.some_method = function () { // метод console.log('some_method invoked'); } return obj; } // Class.prototype=new Red; var obj1 = Class('c'); var obj2 = Class('m'); alert( obj1.pl + ':' + obj2.bel) </script>