module.exports = (function(){

    var prototype = {}
    var instances_counter = 0

    prototype.constructor = function()
    {
        if(!(this instanceof prototype.constructor))
        {
            return new (Function.prototype.bind.apply(prototype.constructor, [null].concat(Array.prototype.slice.call(arguments))))
        }
        this.id = ++instances_counter
    }

    prototype.render = function()
    {
        console.log(this.id)
    }

    prototype.constructor.prototype = prototype
    return prototype.constructor

})()

http://stackoverflow.com/questions/2856059/passing-an-array-as-a-function-parameter-in-javascript
http://stackoverflow.com/questions/3914557/passing-arguments-forward-to-another-javascript-function

[ ]
 

P.S. Присылайте криптовалюту если вам нравится то, что я делаю.
Если не нравится - тоже присылайте.
LTC (Litecoin): LLN6X2uV1iuQ1e4tdmQZsf2RRwh4pxPSej

Leave a Reply

*