If an array or an object is passed to a function as a parameter, then it can also be decomposed into separate values:
function display({ name: userName, age: userAge }) {////indicate which specific parameters from the array we want to get and set variables to them console.log(userName, userAge); } function sum([a, b, c]) {//we indicate the elements of the array that we want to get, and the variables in which these elements will be written in order const result = a + b + c; console.log(result); } let user = { name: "Alexander", age: 33, email: "email@gmail.com" }; let numbers = [3, 5, 7, 8]; display(user); // Alice 33 = name + age sum(numbers); //15 = 3 + 5 + 7