Math.min() is greater Math.max() in Javascript: Detailed explanation.