Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Max JavaScript Methods

function myArrayMax(arr) {
  let len = arr.length;
  let max = -Infinity;
  while (len--) {
    if (arr[len] > max) {
      max = arr[len];
    }
  }
  return max;
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Max #JavaScript #Methods
ADD COMMENT
Topic
Name
2+2 =