Javascript: Math.min() returns NaN

Viewed 7102

I'm trying to create a piece of code in Javascript that compares an array of Epoch times (which are just large integers) and I want it to find the smallest, or most historic, time value.

This is what I've written so far but it just returns 'NaN' when I run it.

var times = [1501502460000,1501497900000,1501498920000,1501493700000];
lowestTime = Math.min(times);

Note that I am using the Math.min() not Math.max().

1 Answers
Related