GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing www.geeksforgeeks.org — JavaScript Array filter() Method - GeeksforGeeks JavaScript Array filter() MethodLast Updated : 1 Jun, 2026 The filter() method creates a new array by selecting elements that meet a specific condition. It does not modify the original array and ignores empty elements.
Syntax array.filter(callback(element, index, arr), thisValue)Parameters: This method accepts five parameters as mentioned above and described below:
Return value: It returns an array of elements that pass the test and an empty array if no elements pass the test. Example 1: Creating a new array consisting of only those elements that satisfy the condition checked by isPositive() function.
Example 2: Creating a new array consisting of only those elements that satisfy the condition checked by isEven() function.
Comment Explore | ||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |