JS_HOME_WORK/70-destructuring-and-rest-operator/solution.js
2025-01-17 01:00:07 +01:00

21 lines
543 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** ЗАДАЧА 70 - Деструктуризация массивов и "rest" оператор
*
* Присвойте переменным "a", "b" и "с" значения, используя
* деструктуризацию массивов и "rest" оператор
*
* Значения переменных должны быть такими как в выводах в консоли
*/
const arr = [1, 2, 3, 4, 5, 6, 7]
const [a, b, ...c] = arr
console.log(a)
// 1
console.log(b)
// 2
console.log(c)
// [3, 4, 5, 6, 7]