I\'ve been debugging this code for about an hour, and it looks like Math.min([1,2]) returns NaN.
Math.min([1,2])
NaN
var int_array = [1,2] console.log(
You pass an array as first parameter to min function
min
From MDN
If at least one of arguments cannot be converted to a number, the result is NaN.