Update filters.js

more elegant code proposal