filmov
tv
Daily JavaScript Problem Solving - Day 02 || Smallest and Biggest Numbers #problemsolving #array

Показать описание
Create a function that takes an array of numbers and return both the minimum and maximum numbers, in that order.
Examples
minMax([1, 2, 3, 4, 5]) ➞ [1, 5]
minMax([2334454, 5]) ➞ [5, 2334454]
minMax([1]) ➞ [1, 1]
Notes
All test arrays will have at least one element and are valid.
Examples
minMax([1, 2, 3, 4, 5]) ➞ [1, 5]
minMax([2334454, 5]) ➞ [5, 2334454]
minMax([1]) ➞ [1, 1]
Notes
All test arrays will have at least one element and are valid.