This function returns the minimum value from a set.
JavaScript:
let minOfSet = set => Math.min(...set);
// Example
console.log(minOfSet(new Set([1, 2, 3, 4, 5]))); // 1
console.log(minOfSet(new Set([-10, -20, -30, -40, -50]))); // -50
TypeScript:
let minOfSet = (set: Set): number => Math.min(...set);
// Example
console.log(minOfSet(new Set([1, 2, 3, 4, 5]))); // 1
console.log(minOfSet(new Set([-10, -20, -30, -40, -50]))); // -50