---
type: snippet
tags: ['javascript', 'array']
status: release
embed: https://stackblitz.com/edit/node-zbv5x8?file=package.json&view=editor
ctime: 2022-04-09
mtime: 2024-03-22
---

[Quick tip: reusable Array search predicates - JASON Format](https://jasonformat.com/reusable-array-search-predicates/)

```js
arr.filter(callback(element[, index[, array]])[, thisArg])
```

배열 메서드에서 2번째 인자 `thisArg`에 참조값을 전달해서 재사용 가능한 함수를 만드는 트릭. 단 성능 이슈가 있으므로 주의해야 한다.