Dr. Derek Austin 🥳
1 min readJul 11, 2020

--

Good question jdrichardstech !!! Thank you so much for reading and responding.

You could write max=array[array.length-1], but you'd have to change the for loop to start from index=0 instead of index=1.

You might also like this article:

"Why Math.max() is Less Than Math.min() in JavaScript" by Dr. Derek Austin https://link.medium.com/J9AOK8wk27

Thanks again!

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

No responses yet