JSFiddle - React, Tailwind, and code Playground
by samando27
JavaScript
function minMax(inputArray) {
return [
Math.min.apply(null, inputArray),
Math.max.apply(null, inputArray),
];
}
const testArray = [38, 62, 55, 39, 4, 28, 37, 88, 41, 85, 92, 72, 100, 61, 63, 86, 44, 60, 22, 83, 94, 80, 81, 46, 17];
console.log(minMax(testArray));