| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 8 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | module.exports = function random(originalArray) { |
||
| 2 | const minimum = 0; |
||
| 3 | const maximum = originalArray.length; |
||
| 4 | const randomIndex = |
||
| 5 | Math.floor(Math.random() * (maximum - minimum)) + minimum; |
||
| 6 | |||
| 7 | return originalArray[randomIndex]; |
||
| 8 | }; |
||
| 9 |