DEV Community

loading...

Coding test snippet

Brandon Ha
Goona be a king of developer and investor. Follow me @iDevBrandon
・1 min read
function getMax(array, length) {
  let max = 0;
  for (let i = 0; i < length; i++) {
    if (array[i] >= max) max = array[i];
  }

  return max;
}
Enter fullscreen mode Exit fullscreen mode

Discussion (0)