export const ArrayUtils = { /** * Allows to convert strings to TitleCase with white spaces Format EG: "the house" becomes "The House" */ flatten: (arr: Array>): Array => { return arr.reduce((p, n) => p.concat(n), []); }, randomFrom: (arr: Array): T => { return arr[Math.floor(Math.random() * arr.length)]; } };