> For the complete documentation index, see [llms.txt](https://edsonha.gitbook.io/my-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edsonha.gitbook.io/my-gitbook/refactoring/code-smells/long-parameter-list.md).

# Long Parameter List

```javascript
//Problem:
function getInvoices(startDate, endDate) {
  //to pull invoices for that duration
}


//**Solution**:
function getInvoices(DateRange) {
  //to pull invoices for that duration
}

class DateRange {
  constructor(start, end) {
    this.startDate = start;
    this.endDate = end;
  }
}
```

```javascript
//Problem:
function availableVacation(anEmployee, grade) {
  // calculate vacation...
}

availableVacation(anEmployee, anEmployee.grade);


//**Solution**:
function availableVacation(anEmployee) {
  const grade = anEmployee.grade;
  // calculate vacation...
}

availableVacation(anEmployee);
```
