JavaScript filter: check the console