(arr, count)
| 801 | } |
| 802 | |
| 803 | randomArray(arr, count) { |
| 804 | count = count || arr.length |
| 805 | let shuffled = arr.slice(0), i = arr.length, min = i - count, temp, |
| 806 | index; |
| 807 | while (i-- > min) { |
| 808 | index = Math.floor((i + 1) * Math.random()); |
| 809 | temp = shuffled[index]; |
| 810 | shuffled[index] = shuffled[i]; |
| 811 | shuffled[i] = temp; |
| 812 | } |
| 813 | return shuffled.slice(min); |
| 814 | } |
| 815 | |
| 816 | now(fmt) { |
| 817 | return format(Date.now(), fmt || 'yyyy-MM-dd HH:mm:ss.SSS') |
no test coverage detected