Pros and cons of standard vs object destructuring function signatures

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the javascript category.

Last Updated: 2024-11-21

What are the relative pros and cons of using a standard function signature vs. object destructuring?

// Standard
calculateCarTax(
  yearFirstRegistered,
  engineCapacity,
  emisssionClass,
  engineType,
  co2Emissions,
  rates
)
// Object destructuring
calculateCarTax({
  yearFirstRegistered,
  engineCapacity,
  emisssionClass,
  engineType,
  co2Emissions,
  rates
})