let string = '10 200 100 1000 5000';
let arr = string.split(' ').filter(function (a) {
return a.startsWith(1) && a.length === 2
})
document.write(arr)
We first split string to each individual piece with (' ') seperator and using map we go over each piece and convert each piece of string to a number with parseFloat(). Let's use parseFloat just in case there might be decimal values. Last step is to spread the array with ... and to return the minimum value from array of numbers using Math.min().
const string = '200 100 10 1000 567 5000 2314235423532';
const lowest = Math.min(
...string.split(' ').map((piece) => {
return parseFloat(piece);
})
);
console.log(lowest);