I need to find the highest number from 3 different numbers. The only thing I\'ve found is max() but you can only use 2 numbers.
Whats the best way?
Push your values into an array arr and use Math.min.apply(null, arr) or Math.max.apply(null, arr) for maximum and minimum values respectively:
arr
Math.min.apply(null, arr)
Math.max.apply(null, arr)
var arr = []; arr.push(value1); arr.push(value2); arr.push(value3); var minValue = Math.min.apply(null, arr); var maxValue = Math.max.apply(null, arr);