Line-Up interview question

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