Hey! What you’re doing is actually a solid start.
To make it less awkward, you can use parameter destructuring directly in the function definition. It makes the code cleaner and self-documenting:
function myFunction({ param1, param2 }) {
if (!param1 || !param2) return;
// use param1 and param2 directly
}
This pattern is super readable and others on your team can instantly see what parameters are expected, no need to dig into the function body.
Also, pairing this with default values makes it even smoother for collaboration.