JavaScript - Min and Max values from an Array of Numbers

I'm a Software Engineer with 9+ years of experience. I've extensive knowledge of different technologies and programming languages. I've skills in Web Development, Databases, and Agile Methodologies. I'm constantly looking to explore new technologies and new opportunities to learn.
You have an array of numbers and you need to know the minimum and maximum values of the array without having to traverse the entire array, don't worry about it, you can get the minimum and maximum values very quickly using the following expression:
let values = [200, 0, 1, 24, -5, 10]
const minValue = Math.min(...values)
const maxValue = Math.max(...values)
console.log(minValue, maxValue)
// Output --> -5 200

Do you know another way to do that? Please if so let me know in the comments below. ✌️😎



