Какова цель Node.js module.exports и как вы его используете?

Мы можем добавить метод в массив.

Array.prototype.getRandomVal = function(){
    return this[Math.floor(Math.random()*this.length)];
};

messages.getRandomVal();
1368
задан GhostGambler 6 May 2014 в 13:56
поделиться