Мы можем добавить метод в массив.
Array.prototype.getRandomVal = function(){ return this[Math.floor(Math.random()*this.length)]; }; messages.getRandomVal();
let test = function() { return "Hello world" }; exports.test = test;