Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to return the max and min of an array in javascript

function minMax(arr) {
  return [Math.min(...arr), Math.max(...arr)];
}
Source by edabit.com #
 
PREVIOUS NEXT
Tagged: #return #max #min #array #javascript
ADD COMMENT
Topic
Name
1+5 =