Using the JavaScript filter Array Method

preview_player
Показать описание
The 'filter' array method returns a new array consisting of only elements in the original array which pass the truth test conducted by the callback function. Using this method instead of creating a loop, conducting the test, and pushing passing values onto an empty array yourself can save you time and make your code cleaner.
Рекомендации по теме