Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/rscmmaryam.aplikasipos.info/node_modules/collect.js/src/methods/
Upload File :
Current File : /home/aplikasiposinfo/www/rscmmaryam.aplikasipos.info/node_modules/collect.js/src/methods/random.js

'use strict';

const values = require('../helpers/values');

module.exports = function random(length = null) {
  const items = values(this.items);

  const collection = new this.constructor(items).shuffle();

  // If not a length was specified
  if (length !== parseInt(length, 10)) {
    return collection.first();
  }

  return collection.take(length);
};

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]