js max value of array
let numbers = [4, 13, 27, 0, -5]; // Get max value of an array in Javascript
Math.max.apply(null, numbers); // returns 27
Math.max(...array);Math.max(5, 10);function minMax(arr) {
return [Math.min(...arr), Math.max(...arr)];
}
Also in JavaScript:
- how to stop user from clicking outside alert box js
- square root js
- passport middleware check if authenticated
- react router browser refresh
- .fetch method
- ajax is not a function
- nested ternary operator javascript
- change image src jquery
- javascript progress of xml http request
- javascript throw new error
- bodyparser express
- vue current year
- remove a class after 100 milliseconds jquery
- remove header from certain pages react navigation
- testing objects for properties javascript
- set variable with json javascript
- creating js objects
- mongodb nodejs connect localhost
- filereader javascript example
- nestjs controller
- jquery option selected
- javascript todataurl
- ngchange angular 8
- copy link to clipboard