export class ObjectUtils { public static pickRandomProperty(obj) { let result; let count = 0; for (const prop in obj) { if (Math.random() < 1 / ++count) { result = prop; } } return result; } public static randomValueFromArray(array: T[]): T { return array[ Math.floor( Math.random() * array.length, ) ]; } }