Created
September 16, 2019 15:57
-
-
Save NyaGarcia/acda431acc93bf7d295d6a24a4b14da5 to your computer and use it in GitHub Desktop.
Passing array elements by index to Math.max function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const numbers = [1, 4, 5]; | |
const max = Math.max(numbers[0], numbers[1], numbers[2]); | |
console.log(max); //Result: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment