This is not testing against Array. Try `arr instanceof Array`? It mostly works.

BTW, `Math.max` returns `-Infinity` on empty list already. Why would you implement it by hand?