I am creating the following array from data attributes and I need to be able to grab the highest and lowest value from it so I can pass it to another function later on.
Find largest and smallest number in an array with lodash.
var array = [1, 3, 2]; var func = _.over(Math.max, Math.min); var [max, min] = func(...array); // => [3, 1] console.log(max); console.log(min);