Alikberov,
а если так?
function generateArray(length, from, last) {
return Array.from({length}, () => Math.floor(from + Math.random() * (last - from + 1)));
}
const array = generateArray(10, 1, 100);
const minimum = Math.min(...array);
console.log(`Minimum of ${array.join()} is ${minimum}`);