Skip to content

Instantly share code, notes, and snippets.

@danielchikaka
Last active December 10, 2021 11:12
Show Gist options
  • Save danielchikaka/b35645dbe2462e5db85a99114ba6e984 to your computer and use it in GitHub Desktop.
Save danielchikaka/b35645dbe2462e5db85a99114ba6e984 to your computer and use it in GitHub Desktop.
Finding the maximum number in array
let arr = [6, 89, 3, 45];
let maximus = Math.max.apply(null, arr);
// Oh, even better
let maximus = Math.max(...arr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment