|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
359 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | var arraySample = require('./_arraySample'),
|
|---|
| 2 | values = require('./values');
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * The base implementation of `_.sample`.
|
|---|
| 6 | *
|
|---|
| 7 | * @private
|
|---|
| 8 | * @param {Array|Object} collection The collection to sample.
|
|---|
| 9 | * @returns {*} Returns the random element.
|
|---|
| 10 | */
|
|---|
| 11 | function baseSample(collection) {
|
|---|
| 12 | return arraySample(values(collection));
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | module.exports = baseSample;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.