DEV Community

Discussion on: Extract Functions Arguments using Destructure in JavaScript

Collapse
 
nombrekeff profile image
Keff

For 2 arguments it is kinda not needed, although when passing in a bunch of arguments it is cleaner to do it this way.

If I have to pass a lot of parameters I tend to use with objects instead:

function omelette({ egg, ingredient }) {}

omelette({ egg:  '🥚', ingredient: '🧀' });