main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
357 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import arraySample from './_arraySample.js';
|
---|
| 2 | import values from './values.js';
|
---|
| 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 | export default baseSample;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.