Is it correct to say that in first example we creating static method on native Javascript Array object and in second example we extending Arrays prototype?
Yes.
Personally I don't see any problem with it and I keep wondering if am I missing something and this method has some major problems I overlook?
Some people who use for in
on arrays might trip over your enumerable max
method. While I personally think that they deserve it, one can play safe
Is it safe to use as
Array.max(arrayhere)
?
Yes, it avoids the enumerability concern. However, you still need to consider that extending javascript natives has its own problems, see also Why is extending native objects a bad practice?. If you chose the static approach anyway, putting them on your own library object instead doesn't complicate anything.