How to use filter function
Used to create a new array from the given array that contains only those elements in the given array that satisfy the conditions set by the parameter function. If you want to know more about the usage of filter function, you can read the following article.