because math is not a constructor max is a static method of math you always use it as mathmax rather than as a method of an instanced math object infinity is the initial comparant because almost every other value is bigger thats why when no arguments are given infinity is returned