function maxNum(arr) {
let max = 0
for (let i = 0; i < arr.length; i++){
if (arr[i] > max ) {
max = arr[i]
}
}
return max
}
console.log(maxNum([2, 4, 8, 0, 5, 10]))
Created
June 17, 2021 04:32
-
-
Save tripdog/5df90df483d5564220efec3f3e0b378c to your computer and use it in GitHub Desktop.
Write a function that returns the biggest number from an array
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment