Destructure an object in a function argument
// destructure the profileData object sent into function as a parameter
const profileUpdate = ( profileData ) => {
const { name, age, nationality, location } = profileData;
// do something with these variables
}
// the above can also be done in-place
const profileUpdate = ( { name, age, nationality, location } ) => {
// do something with these variables
}