function sample(array, from = 0) {
    const length = array.length;
    if (from >= length) {
        return;
    }
    return array[from + Math.floor(Math.random() * (length - from))];
}
Get a random element from `array`

@export
@template T
@param {T[]} array the array
@param {number} [from=0] start index
@returns {T}