Created
September 25, 2020 09:41
-
-
Save belocer/abca7f3e235f525746b8fe765cd39b77 to your computer and use it in GitHub Desktop.
Деструктуризация && минимальное и максимальное число в массиве
This file contains 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 destr_arr = [1, 2, 3, 4, 5, 6, 7, 18] | |
const [a, b] = destr_arr | |
const [c, d, ...e] = destr_arr | |
const [f, g = 42, ...k] = destr_arr | |
console.log(a, b, c, d, e, f, g, k) | |
const arr = [1, 2, 3, 4, 5, 6, 7, 8] | |
console.log(Math.max(...arr)) // 8 | |
console.log(Math.min(...arr)) // 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment