lib/array.js
function $rand(params) {
    if (Array.isArray(params)) {
        return params[Math.floor(Math.random() * params.length)];
    }
    throw new Error('$rand expects an array');
}
function $rand(params) {
    if (Array.isArray(params)) {
        return params[Math.floor(Math.random() * params.length)];
    }
    throw new Error('$rand expects an array');
}
function $rand ( params ) { if ( Array . isArray ( params ) ) { return params [ Math . floor ( Math . random ( ) * params . length ) ] ; } throw new Error ( '$rand expects an array' ) ; }
Return an element at random index

@param {any[]} params
@returns {any}
Return an element at random index