[Closed] Filter Arrays with filter(solution)

I had trouble with this but it turned out to be easy afterall:

[spoiler]var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

var newArray = oldArray.filter(function(val) {
return val < 6;
});[/spoiler]

@annajuare, I am glad you got the solution working, but please do not create multiple threads on the same topic. Also, please remember to put a solution in a spoiler :slight_smile:

I am going to close this thread, and I also closed your other solution thread. I kept your original thread open in case you have any more questions, or please message me if you have a question about me closing it. Again, nothing wrong with posting solution, etc. But there is no need for three threads on the same topic. Happy coding!