I would like to ask you about the differences of the codes below. They both work but I could not find the differences
({ name })
function swimmer({ name }){
return {
swim: () => console.log(`${name} swam`)
}
}
( name )
function swimmer( name ){
return {
swim: () => console.log(`${name} swam`)
}
}