Pregunta de entrevista de Line-Up

What is the difference between for loop and filter function in javascript?