I was reading some information to find the MAX and MIN number from an array, but I saw this code, and I have some doubts…I would appreciate any help provided.
why does the function say function myArrayMax(arr), I know arr is the parameter, but then, the parameter is not given but the function works perfectly in the example. Shouldn’t it be function myArrayMax(points)?
After that, why does it say that var max=-infinity?
Why is it that if the number is > than -infinity it will be the max?
Thank you for your help.