var iDiffMS = [2505600000, 1468800000, -148800000, -1560040000]; alert( iDiffMS.reduce( function ( minValue, current ){ return current > 0 && ( !minValue || minValue > current ) ? current : minValue; }, null ) );