is there a better way to do this? I want return specific properties from object. This way works but i thinking that is not the best way.
target.formats.map(format => {
const {
id,
format_type_id,
payment_type,
initial_date,
final_date,
estimated_audience,
direction_type_id,
price
} = format
return {
id,
format_type_id,
payment_type,
initial_date,
final_date,
estimated_audience,
direction_type_id,
price
}
})