Samples array
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const list = [1,2,3,4,5,6,7,8,9,10];const sub = Arrays.sample(list, 0.5);// Yields: [2, 4, 6, 8, 10] Copy
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const list = [1,2,3,4,5,6,7,8,9,10];const sub = Arrays.sample(list, 0.5);// Yields: [2, 4, 6, 8, 10]
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const list = [1,2,3,4,5,6,7,8,9,10];const sub = Arrays.sample(list, 3);// Yields:// [3, 6, 9] Copy
import { Arrays } from 'https://unpkg.com/ixfx/dist/data.js';const list = [1,2,3,4,5,6,7,8,9,10];const sub = Arrays.sample(list, 3);// Yields:// [3, 6, 9]
Array to sample
Amount, given as a percentage (0..1) or the number of interval (ie 3 for every third item)
Samples array
Example: By percentage - get half of the items
Example: By steps - every third