One Pager Cheat Sheet
- You can find the
maximumandminimumvalue of an array using JavaScript by creating it and accessing its elements. - The
indexof the array determines its minimum value, which in this case is 2, the smallest number of the entire array. - We
settheminimumvariable toInfinityand themaximumvariable to-Infinityto compare values correctly. - Yes, Infinity is greater than 5,000,000 because it is an
unbounded numberthat is higher than any assignable quantity. - Using a For Loop, a comparison of the values inside the array is conducted to find the
maximumandminimumvalues and output them to theconsole. - Utilizing Javascript's built-in functions,
Math.minandMath.max, we can create our own functions to find the minimum and maximum of an array. - The for loop iterates through the
arrayand stores thelargestandsmallest numbersin themaximumandminimumvariables which are outputted as"Max Value: 60"and"Min Value: 2". - The code uses a
for loopto compare each number in the array and updates the values ofminimumandmaximumaccording to the result, then usesgetMaxOfArrayandgetMinOfArrayfunctions to return the maximum and minimum values.

