You could use a switch statement
var biggestSide = Math.max(Height, Length, Depth);
switch (biggestSide) {
case Height:
...
break;
case Length:
...
break;
case Depth:
...
break;
}
After reading your comment:
@mplungjan - in brief, the vars Height, Length and Width and the max values from arrays themselves. I need to identify the array that has the largest value so I can do something with the vars that are pushed to that array. – MeltingDog
I think something like this is what you are after
var maxHeight = Math.max.apply(Math, Height);
var maxLength = Math.max.apply(Math, Length);
var maxDepth = Math.max.apply(Math, Depth);
var biggestSide = Math.max(maxHeight, maxLength, maxDepth);
switch (biggestSide) {
case maxHeight:
// Do something with Height
break;
case maxLength:
// Do something with Length
break;
case maxDepth:
// Do something with Depth
break;
}
Note with ES6 you can use the spread operator instead of the apply function:
var maxHeight = Math.max(...Height);