const profileUpdate = (profileData) => {Это эффективно разрушает объект, отправленный в функцию. Это также можно сделать на месте:
const {name, age, nationality, location} = profileData;
// делаем что-то с этими переменными
}
const profileUpdate = ({имя, возраст, национальность, местоположение}) => {Это устраняет некоторые дополнительные строки и делает наш код удобным. Это имеет дополнительное преимущество: не нужно манипулировать целым объектом в функции; только нужные поля копируются внутри функции.
/ * что-то делать с этими полями * /
}
stats
should be an object
.");'
- text: ''
testString: 'assert(half(stats) === 28.015, "half(stats)
should be 28.015
");'
- text: ''
testString: 'getUserInput => assert(getUserInput("index").match(/\(\s*\{\s*\w+\s*,\s*\w+\s*\}\s*\)/g), "Destructuring was used.");'
```