TypeScript | Array filter() Method
The Array.filter() is an inbuilt TypeScript function which is used to creates a new array with all elements that pass the test implemented by the provided function.
Parameter: This methods accepts two parameter as mentioned and described below:
- callback : This parameter is the Function to test for each element.
- thisObject : This parameter is the Object to use as this when executing callback.
Return Value: This method returns created array.
Below examples illustrate the Array filter() method in TypeScript